commit a1f59f0fd86bab4de0d9a09ae4bfe5fff2084e49
parent 6b9cf607df4d4fc14760401f4b55a17fb5179523
Author: Frederic Cambus <fred@statdns.com>
Date: Mon, 11 Jul 2016 13:10:58 +0200
Changing construct to use while instead
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/strtolower.c b/src/strtolower.c
@@ -13,10 +13,12 @@
char *strtolower(char *str)
{
- char *p;
- for (p = str; *p != '\0'; ++p)
- {
+ char *p = str;
+
+ while (*p) {
*p = tolower((unsigned char) *p);
+ p++;
}
+
return str;
}