blob: 2eba47c959161454ea7229fbb907ae8963e3256e [file] [log] [blame]
Antonio Nino Diaz9eddb1e2018-08-16 14:53:05 +01001/*
2 * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <stddef.h>
8
9void *memchr(const void *src, int c, size_t len)
10{
11 const char *s = src;
12
13 while (len--) {
14 if (*s == c)
15 return (void *) s;
16 s++;
17 }
18
19 return NULL;
20}