Reduce some var scopes

This commit is contained in:
Philippe Teuwen 2019-06-07 18:41:39 +02:00
commit 732bc766f9
52 changed files with 318 additions and 409 deletions

View file

@ -80,10 +80,10 @@ char *strcat(char *dest, const char *src) {
/* reverse: reverse string s in place */
void strreverse(char s[]) {
int c, i, j;
int j = strlen(s) - 1;
for (i = 0, j = strlen(s) - 1; i < j; i++, j--) {
c = s[i];
for (int i = 0; i < j; i++, j--) {
int c = s[i];
s[i] = s[j];
s[j] = c;
}