Changes in uspace/lib/posix/src/string.c [2498b95:7c3fb9b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/src/string.c
r2498b95 r7c3fb9b 288 288 289 289 return 0; 290 } 291 292 /** 293 * Find byte in memory. 294 * 295 * @param mem Memory area in which to look for the byte. 296 * @param c Byte to look for. 297 * @param n Maximum number of bytes to be inspected. 298 * @return Pointer to the specified byte on success, 299 * NULL pointer otherwise. 300 */ 301 void *memchr(const void *mem, int c, size_t n) 302 { 303 assert(mem != NULL); 304 305 const unsigned char *s = mem; 306 307 for (size_t i = 0; i < n; ++i) { 308 if (s[i] == (unsigned char) c) { 309 return (void *) &s[i]; 310 } 311 } 312 return NULL; 290 313 } 291 314
Note:
See TracChangeset
for help on using the changeset viewer.