shithub: scc

Download patch

ref: 992fd380a19def81095e9d5fed9b924e97da4145
parent: ddf32b64ea557c2f9f3adec475288cbffc9b12fc
author: Quentin Rameau <quinq@fifth.space>
date: Thu Feb 16 20:29:50 EST 2017

[libc] Make strrchr style consistent with the rest

--- 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;
 }