mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 08:22:44 +00:00
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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=5071
@ -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