ref: 75c9d51d40bda19e01032c0aaae242d87e5cd13f
parent: e60c1d7378244fa05895a4a3a330816c2a68094d
author: Amavect <amavect@gmail.com>
date: Sun May 22 18:48:37 EDT 2022
silence runestrchr while(assign) warning
--- a/libc/runestrchr.c
+++ b/libc/runestrchr.c
@@ -4,17 +4,14 @@
Rune*
runestrchr(Rune *s, Rune c)
{
- Rune c0 = c;
- Rune c1;
+ Rune r;
- if(c == 0) {
+ if(c == 0)
while(*s++)
;
- return s-1;
- }
-
- while(c1 = *s++)
- if(c1 == c0)
- return s-1;
- return 0;
+ else
+ while((r = *s++) != c)
+ if(r == 0)
+ return 0;
+ return s-1;
}