bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

updated file for coreutils-5.tar.gz/coreutils-5.0/lib/strstr.c


From: Digital
Subject: updated file for coreutils-5.tar.gz/coreutils-5.0/lib/strstr.c
Date: Thu, 19 Feb 2004 17:56:13 -0500

Hello,
Please accept this updated version of strstr.c as found in the gnu coreutils-5.0

It should run faster than the original strstr.c routine.


Originally looked at strstr.c to modify the /* possible ANSI violation */
This appeared as a simple fix of converting ++haystack to haystack--.
This however lead to other fixes that resulted in the file you have attached 
here.

As a side comment, There is a BUG with strstr.c
If haystack gets truncated or there is no trailing '\0', then strstr will keep 
looking past the expected string end into unknown space.
(there are several routines in string.h that falls into that category, 
basically all routines looking for a trailing '\0').
I was thinking of fixing it so it wouldn't, but then there is the problem of 
how big a limit must it accept, 512?, 1024?, as I don't think there is a clear 
answer for that, I must leave this 'bug' alone, since some of us may accept a 
string of 512bytes as acceptable, while some of us need to work on strings 
exceeding 1meg in size.


Attachment: strstr.tar.gz
Description: GNU Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]