index -> strchr / rindex -> strrchr
dillon at apollo.backplane.com
Mon Aug 30 17:07:02 PDT 2004
Generally speaking I like the work you are doing, and I'll get to
it when I get back from my little mini vacation :-)
However, I would enter a note of caution when it comes to running
function name replacement. Many of these replacements, probably most
of them, do not really move the project forward.
For example, I am wholely in favor of getting rid of strcpy(), strcat(),
mktemp(), and so forth... functions that are inherently insecure should
definitely be replaced, even for trivial uses.
I would be in favor of fixing up index() and rindex() since the mainstream
uses of strchr() and strrchr() these days .
I would not, however, replace any ofthe b*() functions. The bozos making
the new standards screwed up big time IMHO. I far prefer bzero(), bcmp(),
and bcopy() to junk they replaced them with.
:ftime - get date and time (LEGACY)
:getwd - get the current working directory pathname (LEGACY)
:index - character string operations (LEGACY)
:mktemp - make a unique filename (LEGACY)
:rindex - character string operations (LEGACY)
:utimes - set file access and modification times (LEGACY)
:wcswcs - find a wide substring (LEGACY)
:My second question is, should I change this everywhere, or just in bin/,
:sbin/, usr.bin/ and usr.sbin/ or also in lib/, sys/, et cetera? (I presume
:that these changes should not be made in contrib/ and gnu/ directories?
:Let me know what you guys think.
As a rule these sorts of changes should NOT be made to contrib/ code
or third-party maintained code. I would stick with the primary
directories for now. bin, sbin, usr.bin, usr.sbin, lib. Even sys,
though that requires a more involved review.
<dillon at xxxxxxxxxxxxx>
More information about the Submit