aboutsummaryrefslogtreecommitdiffstats
path: root/src/string/strchr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/strchr.c')
-rw-r--r--src/string/strchr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string/strchr.c b/src/string/strchr.c
index e046ea7..bf79a0b 100644
--- a/src/string/strchr.c
+++ b/src/string/strchr.c
@@ -151,6 +151,6 @@ char* strrchr(const char* string, int c)
if (*string == c)
r = string;
else if (!*string++)
- return r;
+ return c ? r : (string - 1);
}