diff --git a/libbrux/ChangeLog b/libbrux/ChangeLog index 29c7dcc6..e483cbc7 100644 --- a/libbrux/ChangeLog +++ b/libbrux/ChangeLog @@ -1,3 +1,8 @@ +2003-06-09 Marcel Telka + + * cmd/cmd.c (cmd_get_number): Added variable initialization for %n conversion in sscanf() call. + * cmd/help.c (cmd_help_run): Removed duplicate 'i' variable declaration. + 2003-06-03 Marcel Telka * flash/detectflash.c (detectflash): Renamed detect_cfi to cfi_detect. diff --git a/libbrux/cmd/cmd.c b/libbrux/cmd/cmd.c index 0e4ee1aa..f4a819ba 100644 --- a/libbrux/cmd/cmd.c +++ b/libbrux/cmd/cmd.c @@ -65,15 +65,19 @@ cmd_get_number( char *s, unsigned int *i ) { int n; int r; - int l; + size_t l; if (!s || !i) return -1; l = strlen( s ); + + n = -1; r = sscanf( s, "0x%x%n", i, &n); if (r == 1 && n == l) return 0; + + n = -1; r = sscanf( s, "%u%n", i, &n ); if (r == 1 && n == l) return 0; diff --git a/libbrux/cmd/help.c b/libbrux/cmd/help.c index 916d464d..05a04c81 100644 --- a/libbrux/cmd/help.c +++ b/libbrux/cmd/help.c @@ -36,7 +36,6 @@ cmd_help_run( char *params[] ) /* short description generation */ if (!params[1]) { - int i; printf( _("Command list:\n\n") ); for (i = 0; cmds[i]; i++) printf( _("%-13s %s\n"), cmds[i]->name, cmds[i]->desc ? _(cmds[i]->desc) : _("(no description available)") );