Skip to content

Commit

Permalink
Fixed the limit for hopper and category names.
Browse files Browse the repository at this point in the history
  • Loading branch information
craftycodie committed Nov 12, 2024
1 parent d2b1a9c commit ac682c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ use serde_hex::{SerHex,StrictCap};
pub struct s_game_hopper_custom_category {
pub category_identifier: u16,
pub category_image_index: u8,
pub category_name: StaticString<32>,
pub category_name: StaticString<15>,
}

#[derive(Clone, Default, PartialEq, Debug, Serialize, Deserialize)]
pub struct c_hopper_configuration {
pub hopper_name: StaticString<32>,
pub hopper_name: StaticString<15>,
pub game_set_hash: s_network_http_request_hash,
pub hopper_identifier: u16,
pub hopper_category: u16,
Expand Down
2 changes: 1 addition & 1 deletion blf_lib/src/types/c_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl<const N: usize> StaticString<N> {
pub fn set_string(&mut self, value: &String) -> Result<(), String> {
let bytes = value.as_bytes();
if bytes.len() > N {
return Err(format!("String too long ({} > {}) bytes", N, bytes.len()));
return Err(format!("String \"{value}\" too long ({} > {}) bytes", N, bytes.len()));
}
self.buf.fill(0);
self.buf[..bytes.len()].copy_from_slice(bytes);
Expand Down

0 comments on commit ac682c7

Please sign in to comment.