Fixing broken loop formatting

This commit is contained in:
Imbus 2024-08-07 16:07:20 +02:00
parent fbfb728b8f
commit 9b339273bb
8 changed files with 16 additions and 31 deletions

View file

@ -10,8 +10,7 @@ fmtname(char *path)
char *p;
// Find first character after last slash.
for(p = path + strlen(path); p >= path && *p != '/'; p--)
;
for(p = path + strlen(path); p >= path && *p != '/'; p--) {}
p++;
// Return blank-padded name.

View file

@ -20,8 +20,7 @@ strcpy(char *s, const char *t)
char *os;
os = s;
while((*s++ = *t++) != 0)
;
while((*s++ = *t++) != 0) {}
return os;
}
@ -38,8 +37,7 @@ strlen(const char *s)
{
int n;
for(n = 0; s[n]; n++)
;
for(n = 0; s[n]; n++) {}
return n;
}

View file

@ -823,8 +823,7 @@ preempt(char *s)
exit(1);
}
if(pid1 == 0)
for(;;)
;
for(;;) {}
pid2 = fork();
if(pid2 < 0) {
@ -832,8 +831,7 @@ preempt(char *s)
exit(1);
}
if(pid2 == 0)
for(;;)
;
for(;;) {}
pipe(pfds);
pid3 = fork();
@ -846,8 +844,7 @@ preempt(char *s)
if(write(pfds[1], "x", 1) != 1)
printf("%s: preempt write error", s);
close(pfds[1]);
for(;;)
;
for(;;) {}
}
close(pfds[1]);