diff options
author | wollman <wollman@FreeBSD.org> | 2001-07-16 15:49:58 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 2001-07-16 15:49:58 +0000 |
commit | 4281e598d5e8c06f1af2e4c819ab8a81eb7947a4 (patch) | |
tree | 569a9eb4358da15600cf335ffb6c87b15f4d23dc /bin/df | |
parent | f621704c2a19b20a4380ff3becf506ac2cb5f931 (diff) | |
download | FreeBSD-src-4281e598d5e8c06f1af2e4c819ab8a81eb7947a4.zip FreeBSD-src-4281e598d5e8c06f1af2e4c819ab8a81eb7947a4.tar.gz |
Fix style bugs introduced by rev 1.28. No functional changes.
Diffstat (limited to 'bin/df')
-rw-r--r-- | bin/df/df.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/bin/df/df.c b/bin/df/df.c index 3cec5dd..c7a13bf 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -518,7 +518,8 @@ usage() exit(EX_USAGE); } -char *makenetvfslist() +char * +makenetvfslist() { char *str, *strptr, **listptr; int mib[3], maxvfsconf, cnt=0, i; @@ -533,31 +534,31 @@ char *makenetvfslist() return (NULL); } - if ((listptr=malloc(sizeof(char*) * maxvfsconf)) == NULL) { + if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { warnx("malloc failed"); return (NULL); } - for (ptr=getvfsent();ptr;ptr=getvfsent()) + for (ptr = getvfsent(); ptr; ptr = getvfsent()) if (ptr->vfc_flags & VFCF_NETWORK) { - listptr[cnt++] = strdup (ptr->vfc_name); - if (! listptr[cnt-1]) { + listptr[cnt++] = strdup(ptr->vfc_name); + if (listptr[cnt-1] == NULL) { warnx("malloc failed"); return (NULL); } } - if ((str = malloc(sizeof(char)*(32*cnt+cnt+2))) == NULL) { + if ((str = malloc(sizeof(char) * (32 * cnt + cnt + 2))) == NULL) { warnx("malloc failed"); free(listptr); return (NULL); } - *str = 'n'; *(str+1) = 'o'; - for (i = 0,strptr=str+2; i < cnt; i++,strptr++) { - strncpy (strptr, listptr[i], 32); - strptr+=strlen(listptr[i]); - *strptr=','; + *str = 'n'; *(str + 1) = 'o'; + for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) { + strncpy(strptr, listptr[i], 32); + strptr += strlen(listptr[i]); + *strptr = ','; free(listptr[i]); } *(--strptr) = NULL; |