diff options
-rw-r--r-- | miscutils/strings.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/miscutils/strings.c b/miscutils/strings.c index 5dcd876e9..92e9f0d11 100644 --- a/miscutils/strings.c +++ b/miscutils/strings.c @@ -67,7 +67,7 @@ int strings_main(int argc, char **argv) i=0; string=xmalloc(n+1); - /*string[n]='\0';*/ + string[n]='\0'; n-=1; if(argc==0) @@ -77,7 +77,7 @@ int strings_main(int argc, char **argv) goto pipe; } - for( ;*argv!=NULL;*argv++) + for( ;*argv!=NULL && argc>0;argv++) { if((file=bb_wfopen(*argv,"r"))) { |