stdlib/strrchrnul.c
raw| 1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
| 2 | /* Copyright 2017 The NASM Authors - All Rights Reserved */ |
| 3 | |
| 4 | #include "compiler.h" |
| 5 | |
| 6 | #ifndef HAVE_STRRCHRNUL |
| 7 | |
| 8 | char * pure_func strrchrnul(const char *s, int c) |
| 9 | { |
| 10 | char *p; |
| 11 | |
| 12 | p = strrchr(s, c); |
| 13 | if (!p) |
| 14 | p = strchr(s, '\0'); |
| 15 | |
| 16 | return p; |
| 17 | } |
| 18 | |
| 19 | #endif |