diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-09 19:41:18 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-09 19:41:18 +0100 |
commit | f90436dd7415354105a27846e587adefaea7ef63 (patch) | |
tree | ed8390925b4d6b3a0c71b189d04e79d4333aa3aa /src/common | |
parent | 440d9dc470703d20a55365b3a560196e71d450d4 (diff) | |
download | kogata-f90436dd7415354105a27846e587adefaea7ef63.tar.gz kogata-f90436dd7415354105a27846e587adefaea7ef63.zip |
Make way for nullfs
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/common.lib | bin | 35275 -> 35663 bytes | |||
-rw-r--r-- | src/common/include/string.h | 1 | ||||
-rw-r--r-- | src/common/string.c | 8 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/common/common.lib b/src/common/common.lib Binary files differindex 058abeb..55de3ef 100644 --- a/src/common/common.lib +++ b/src/common/common.lib 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; |