Obtained from: 386BSD-0.1 patchkit; also fixed in 1.1.5
Compare unsigned chars. Return the place after where the character was found and not the start of the string.
This commit is contained in:
parent
a2c0622293
commit
a0d0470f49
@ -49,9 +49,10 @@ memccpy(t, f, c, n)
|
||||
if (n) {
|
||||
register unsigned char *tp = t;
|
||||
register const unsigned char *fp = f;
|
||||
register unsigned char uc = c;
|
||||
do {
|
||||
if ((*tp++ = *fp++) == c)
|
||||
return (t);
|
||||
if ((*tp++ = *fp++) == uc)
|
||||
return (tp);
|
||||
} while (--n != 0);
|
||||
}
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user