host_strrchr.c 318 B

12345678910111213141516171819
  1. /*
  2. * strchr-like wrapper around host_strchr_internal.
  3. */
  4. #include <stdbool.h>
  5. #include <string.h>
  6. #include "defs.h"
  7. #include "misc.h"
  8. #include "utils/utils.h"
  9. char *host_strrchr(const char *s, int c)
  10. {
  11. char set[2];
  12. set[0] = c;
  13. set[1] = '\0';
  14. return (char *) host_strchr_internal(s, set, false);
  15. }