From f90436dd7415354105a27846e587adefaea7ef63 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 9 Feb 2015 19:41:18 +0100 Subject: Make way for nullfs --- src/common/common.lib | Bin 35275 -> 35663 bytes src/common/include/string.h | 1 + src/common/string.c | 8 ++++++++ 3 files changed, 9 insertions(+) (limited to 'src/common') diff --git a/src/common/common.lib b/src/common/common.lib index 058abeb..55de3ef 100644 Binary files a/src/common/common.lib and b/src/common/common.lib differ diff --git a/src/common/include/string.h b/src/common/include/string.h index a7a5253..9608dd5 100644 --- a/src/common/include/string.h +++ b/src/common/include/string.h @@ -10,6 +10,7 @@ void *memmove(void *dest, const void *src, size_t count); size_t strlen(const char *str); char *strchr(const char *str, char c); +char *strrchr(const char *str, char c); char *strcpy(char *dest, const char *src); char *strcat(char *dest, const char *src); int strcmp(const char *s1, const char *s2); diff --git a/src/common/string.c b/src/common/string.c index 027bf03..dc25aee 100644 --- a/src/common/string.c +++ b/src/common/string.c @@ -16,6 +16,14 @@ char *strchr(const char *str, char c) { return NULL; } +char *strrchr(const char *str, char c) { + char* ret = NULL; + do { + if (*str == c) ret = (char*)str; + } while (*(str++)); + return ret; +} + char *strcpy(char *dest, const char *src) { memcpy(dest, src, strlen(src) + 1); return (char*)src; -- cgit v1.2.3