packages/utils/cmdpad/patches/160-format.patch
Rosen Penev a6fbf0e234 cmdpad: fix bad scanf format
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-11-11 11:51:41 +08:00

12 lines
403 B
Diff

--- a/src/parse.c
+++ b/src/parse.c
@@ -257,7 +257,7 @@ int ParseCommand( char * pchCommandLine)
pchValue = strtok( pchValue, ",") ;
d2printf( "Value is '%s'\n", pchValue) ;
- if( (pchValue == NULL ) || ( sscanf( pchValue, "%d", &code) != 1) )
+ if( (pchValue == NULL ) || ( sscanf( pchValue, "%hu", &code) != 1) )
return -1 ;
pchValue = strtok( NULL, ",") ;