Wel. had you looked at the second hit (really near the top,
so boredom should not have set in yet) searching for why it was a hit
you would have seen several instances of str*** func calls being
replaced by strn*** func when the str ones were unsafe. Seeing that it
was all about a
Rod.. Whitworth wrote:
/* Made up example of course */
- if (!strcmp(buf,n/a))
+ if (!strncmp(buf,n/a,3))
you would have seen several instances of str*** func calls being
replaced by strn*** func when the str ones were unsafe. Seeing that it
The one has little to do with the other.
In the meantime, we're a few posts down the road from the original
question, and I haven't seen any answer; neither on the list, nor on the
Net. I suppose it has something to do with strcmp continuing to compare
until it finds a char with value 0, but I can think of many situations
where
Rod.. Whitworth wrote:
/* Made up example of course */
- if (!strcmp(buf,n/a))
+ if (!strncmp(buf,n/a,3))
you would have seen several instances of str*** func calls being
replaced by strn*** func when the str ones were unsafe. Seeing that it
The one has little to do with the other. What if
--- Rod.. Whitworth [EMAIL PROTECTED] wrote:
On Sun, 13 Nov 2005 17:22:42 -0800 (PST), patrick ~ wrote:
/* Made up example of course */
- if (!strcmp(buf,n/a))
+ if (!strncmp(buf,n/a,3))
Is there a real value in doing this?
I don't see it.
Can someone shed some light on this
I've been looking in some of the
ports I have interest in and I
have noticed a lot of changes in
the patches directory where we are
replacing 'strcmp' instances with
'strncmp'.
e.g.,
/* Made up example of course */
- if (!strcmp(buf,n/a))
+ if (!strncmp(buf,n/a,3))
Is there a real value
On Sun, 13 Nov 2005 17:22:42 -0800 (PST), patrick ~ wrote:
I've been looking in some of the
ports I have interest in and I
have noticed a lot of changes in
the patches directory where we are
replacing 'strcmp' instances with
'strncmp'.
e.g.,
/* Made up example of course */
- if