Skip to content

Commit

Permalink
Improvements to test-Z80.
Browse files Browse the repository at this point in the history
  • Loading branch information
redcode committed Feb 29, 2024
1 parent 1ce1ee6 commit 976270b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sources/test-Z80.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,13 +704,13 @@ static zboolean is_option(char const* string, char const* short_option, char con
{return !strcmp(string, short_option) || !strcmp(string, long_option);}


static zboolean to_uint8(char const* string, zuint8 maximum_value, zuint8 *byte)
static zboolean to_uint8(char const* string, zuint8 maximum, zuint8 *byte)
{
char *end;
zulong value = strtoul(string, &end, 0);

if (end == string || *end || value > maximum_value) return Z_FALSE;
if (byte != Z_NULL) *byte = (zuint8)value;
if (end == string || *end || value > maximum) return Z_FALSE;
*byte = (zuint8)value;
return Z_TRUE;
}

Expand Down

0 comments on commit 976270b

Please sign in to comment.