Skip to content

Commit

Permalink
Program Data: actually check the len in bytes for the name
Browse files Browse the repository at this point in the history
  • Loading branch information
fengalin committed Jan 30, 2024
1 parent bfa792d commit 8b61c34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jstation/data/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl ProgramData {
const NAME_MAX_LEN: usize = 40;

fn try_new(buf: Box<[RawValue; Self::PARAM_COUNT]>, name: String) -> Result<Self, Error> {
if name.len() > Self::NAME_MAX_LEN {
if name.as_bytes().len() > Self::NAME_MAX_LEN {
return Err(Error::ProgramNameOutOfRange(name.len()));
}

Expand Down

0 comments on commit 8b61c34

Please sign in to comment.