Changeset 2498b95 in mainline for uspace/lib/posix/src/string.c
- Timestamp:
- 2018-06-25T15:49:26Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fbfe59d
- Parents:
- bfe90b6
- git-author:
- Jiri Svoboda <jiri@…> (2018-06-24 19:48:37)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-06-25 15:49:26)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/src/string.c
rbfe90b6 r2498b95 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;313 290 } 314 291
Note:
See TracChangeset
for help on using the changeset viewer.