commit ff2c7c9b2b116228e9170c5b77c987572b5ad5ba
Author:     Quentin Rameau <[email protected]>
AuthorDate: Fri Feb 17 01:29:50 2017 +0100
Commit:     Quentin Rameau <[email protected]>
CommitDate: Fri Feb 17 11:00:33 2017 +0100

    [libc] Make strrchr style consistent with the rest

diff --git a/libc/src/strrchr.c b/libc/src/strrchr.c
index 2f246d1..5b8b366 100644
--- a/libc/src/strrchr.c
+++ b/libc/src/strrchr.c
@@ -5,11 +5,11 @@
 char *
 strrchr(const char *s, int c)
 {
-       char *t;
+       const char *t = s;
 
-       for (t = (char *) s; *t; ++t)
-               /* nothing */;
+       while (*t)
+               ++t;
        while (t > s && *t != c)
                --t;
-       return (*t == c) ? t : NULL;
+       return (*t == c) ? (char *)t : NULL;
 }

Reply via email to