space fixes

This commit is contained in:
Michael Kerrisk 2007-06-20 20:52:14 +00:00
parent 89f9f5b25d
commit d494919067
10 changed files with 13 additions and 13 deletions

View File

@ -245,7 +245,7 @@ main(void)
err = fmtmsg(class, "util-linux:mount", MM_ERROR, err = fmtmsg(class, "util-linux:mount", MM_ERROR,
"unknown mount option", "See mount(8).", "unknown mount option", "See mount(8).",
"util-linux:mount:017"); "util-linux:mount:017");
switch(err) { switch (err) {
case MM_OK: case MM_OK:
break; break;
case MM_NOTOK: case MM_NOTOK:

View File

@ -69,7 +69,7 @@ main(void)
getgrouplist(user, pw->pw_gid, groups, &ng); getgrouplist(user, pw->pw_gid, groups, &ng);
} }
for(i = 0; i < ng; i++) for (i = 0; i < ng; i++)
printf("%d\en", groups[i]); printf("%d\en", groups[i]);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);

View File

@ -153,7 +153,7 @@ int main(int argc, char **argv)
int errfnd = 0; int errfnd = 0;
while ((opt = getopt(argc, argv, "o:")) != -1) { while ((opt = getopt(argc, argv, "o:")) != -1) {
switch(opt) { switch (opt) {
case 'o': case 'o':
subopts = optarg; subopts = optarg;
while (*subopts != '\\0' && !errfnd) { while (*subopts != '\\0' && !errfnd) {

View File

@ -138,7 +138,7 @@ main(void)
if (n < 0) if (n < 0)
perror("scandir"); perror("scandir");
else { else {
while(n\-\-) { while (n\-\-) {
printf("%s\en", namelist[n]\->d_name); printf("%s\en", namelist[n]\->d_name);
free(namelist[n]); free(namelist[n]);
} }

View File

@ -237,7 +237,7 @@ foo(va_alist)
va_list ap; va_list ap;
va_start(ap); va_start(ap);
while(...) { while (...) {
... ...
x = va_arg(ap, type); x = va_arg(ap, type);
... ...
@ -289,7 +289,7 @@ foo(char *fmt, ...)
va_start(ap, fmt); va_start(ap, fmt);
while (*fmt) while (*fmt)
switch(*fmt++) { switch (*fmt++) {
case 's': /* string */ case 's': /* string */
s = va_arg(ap, char *); s = va_arg(ap, char *);
printf("string %s\en", s); printf("string %s\en", s);

View File

@ -79,7 +79,7 @@ strncat(char *dest, const char *src, size_t n)
size_t dest_len = strlen(dest); size_t dest_len = strlen(dest);
int i; int i;
for(i = 0 ; i < n && src[i] != '\\0' ; i++) for (i = 0 ; i < n && src[i] != '\\0' ; i++)
dest[dest_len + i] = src[i]; dest[dest_len + i] = src[i];
dest[dest_len + i] = '\\0'; dest[dest_len + i] = '\\0';

View File

@ -78,9 +78,9 @@ char*
strncpy(char *dest, const char *src, size_t n){ strncpy(char *dest, const char *src, size_t n){
size_t i; size_t i;
for(i = 0 ; i < n && src[i] != '\\0' ; i++) for (i = 0 ; i < n && src[i] != '\\0' ; i++)
dest[i] = src[i]; dest[i] = src[i];
for( ; i < n ; i++) for ( ; i < n ; i++)
dest[i] = '\\0'; dest[i] = '\\0';
return dest; return dest;

View File

@ -95,7 +95,7 @@ E.g.
.br .br
.nf .nf
while(something) { while (something) {
int ret = system("foo"); int ret = system("foo");
if (WIFSIGNALED(ret) && if (WIFSIGNALED(ret) &&

View File

@ -218,7 +218,7 @@ action(const void *nodep, const VISIT which, const int depth)
{ {
int *datap; int *datap;
switch(which) { switch (which) {
case preorder: case preorder:
break; break;
case postorder: case postorder:

View File

@ -184,14 +184,14 @@ from where it stopped before.
.nf .nf
struct epoll_event ev, *events; struct epoll_event ev, *events;
for(;;) { for (;;) {
nfds = epoll_wait(kdpfd, events, maxevents, \-1); nfds = epoll_wait(kdpfd, events, maxevents, \-1);
for (n = 0; n < nfds; ++n) { for (n = 0; n < nfds; ++n) {
if (events[n].data.fd == listener) { if (events[n].data.fd == listener) {
client = accept(listener, (struct sockaddr *) &local, client = accept(listener, (struct sockaddr *) &local,
&addrlen); &addrlen);
if(client < 0){ if (client < 0){
perror("accept"); perror("accept");
continue; continue;
} }