diff options
Diffstat (limited to 'utils/host_strrchr.c')
-rw-r--r-- | utils/host_strrchr.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/utils/host_strrchr.c b/utils/host_strrchr.c new file mode 100644 index 00000000..a1dd4c94 --- /dev/null +++ b/utils/host_strrchr.c @@ -0,0 +1,18 @@ +/* + * strchr-like wrapper around host_strchr_internal. + */ + +#include <stdbool.h> +#include <string.h> + +#include "defs.h" +#include "misc.h" +#include "utils/utils.h" + +char *host_strrchr(const char *s, int c) +{ + char set[2]; + set[0] = c; + set[1] = '\0'; + return (char *) host_strchr_internal(s, set, false); +} |