Thanks for then reminder! But I think the first patch is better, since the default min length is 4. Regards Chu Li > -----Original Message----- > From: util-linux-ng-owner@xxxxxxxxxxxxxxx > [mailto:util-linux-ng-owner@xxxxxxxxxxxxxxx] On Behalf Of chuli > Sent: Friday, February 01, 2008 4:30 PM > To: util-linux-ng@xxxxxxxxxxxxxxx > Subject: [PATCH] strings: use '-0' as option will meet infinite loop > > When I use the command "strings" like this: "strings -0 file" will trap > in infinite loop. > The binutils version is 2.17.50.0.6. Has this bug been fixed? > If not, here is my patch. > Thank you. > > Chu Li > > Signed-off-by: Chu Li <chul@xxxxxxxxxxxxxxxxx> > ---------------------------------------------- > diff --git a/strings.c b/strings.c > index 4c68ea8..8ee2783 100644 > --- a/strings.c > +++ b/strings.c > @@ -274,6 +274,9 @@ main (int argc, char **argv) > } > } > > + if(string_min == 0) > + fatal (_("invalid number %d"), string_min); > + > if (string_min < 0) > string_min = 4; > > - > To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html