File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,11 @@ int main(int argc, char *argv[])
194194 exit (127 );
195195 }
196196
197- reg = strtoul (argv [optind ], NULL , 0 );
197+ reg = strtoul (argv [optind ], & endarg , 0 );
198+ if (* endarg ) {
199+ printf ("Failed to parse register number. Do you need a prefix?\n" );
200+ exit (127 );
201+ }
198202
199203 if (cpu == -1 ) {
200204 doing_for_all = 1 ;
Original file line number Diff line number Diff line change @@ -121,7 +121,11 @@ int main(int argc, char *argv[])
121121 exit (127 );
122122 }
123123
124- reg = strtoul (argv [optind ++ ], NULL , 0 );
124+ reg = strtoul (argv [optind ++ ], & endarg , 0 );
125+ if (* endarg ) {
126+ printf ("Failed to parse register number. Do you need a prefix?\n" );
127+ exit (127 );
128+ }
125129
126130 if (cpu == -1 ) {
127131 doing_for_all = 1 ;
You can’t perform that action at this time.
0 commit comments