From a067aeceed8839e5516b9543d6842fdb0383237d Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Mon, 16 Jul 2001 15:49:58 +0000 Subject: [PATCH] Fix style bugs introduced by rev 1.28. No functional changes. --- bin/df/df.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/bin/df/df.c b/bin/df/df.c index 3cec5ddcbd74..c7a13bf54ba2 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;