"A little patch for the strings applet of the busybox development tree
authorGlenn L McGrath <bug1@ihug.co.nz>
Fri, 29 Aug 2003 15:48:37 +0000 (15:48 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Fri, 29 Aug 2003 15:48:37 +0000 (15:48 -0000)
that substitutes two lines of code with a libbb function saving a couple
of bytes." - Tito

miscutils/strings.c

index c914338d5498ccb2c0f19e95a5429d5d2f42a868..6e45345855aabdd6444147286df859f0e3ebced7 100644 (file)
@@ -82,8 +82,7 @@ int strings_main(int argc, char **argv)
 pipe:
 
                        count=0;
-                       do
-                       {
+                       do{
                                c=fgetc(file);
                                if(ISSTR(c))
                                {
@@ -110,11 +109,9 @@ pipe:
                                        i=0;
                                }
                                count++;
-                       }
-                       while(c!=EOF);
+                       }while(c!=EOF);
 
-                       if(file!=stdin)
-                               fclose(file);
+                       bb_fclose_nonstdin(file);
                }
                else
                {