diff options
| author | Josef Karthauser <joe@FreeBSD.org> | 2000-06-17 01:43:56 +0000 |
|---|---|---|
| committer | Josef Karthauser <joe@FreeBSD.org> | 2000-06-17 01:43:56 +0000 |
| commit | d502d9ac462524b83444fe7bc0341c325f26570f (patch) | |
| tree | 78fa168bed9713ac237c75317e70aeb4245b6ef1 /lib | |
| parent | b81eeaf0a683f272af61e1f6789adbabe06b72f1 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/gen/strtofflags.3 | 6 | ||||
| -rw-r--r-- | lib/libc/gen/strtofflags.c | 7 |
2 files changed, 5 insertions, 8 deletions
diff --git a/lib/libc/gen/strtofflags.3 b/lib/libc/gen/strtofflags.3 index c12551aeec59..f287c172cf73 100644 --- a/lib/libc/gen/strtofflags.3 +++ b/lib/libc/gen/strtofflags.3 @@ -44,7 +44,7 @@ .Sh SYNOPSIS .Fd #include <unistd.h> .Ft char * -.Fn fflagstostr "u_long flags" "char *def" +.Fn fflagstostr "u_long flags" .Ft int .Fn strtofflags "char **stringp" "u_long *setp" "u_long *clrp" .Sh DESCRIPTION @@ -52,9 +52,7 @@ The .Fn fflagstostr function returns a comma separated string of the file flags represented by .Fa flags . -If no flags are set the string -.Fa def -is returned instead. +If no flags are set a zero length string is returned. .Pp The .Fn strtofflags diff --git a/lib/libc/gen/strtofflags.c b/lib/libc/gen/strtofflags.c index 2cf6f39c484d..d9d2dc4f37b2 100644 --- a/lib/libc/gen/strtofflags.c +++ b/lib/libc/gen/strtofflags.c @@ -76,12 +76,11 @@ static struct { /* * fflagstostr -- * Convert file flags to a comma-separated string. If no flags - * are set, return the default string. + * are set, return the empty string. */ char * -fflagstostr(flags, def) +fflagstostr(flags) u_long flags; - char *def; { static char string[128]; char *sp, *dp; @@ -100,7 +99,7 @@ fflagstostr(flags, def) } } *dp = '\0'; - return (dp == string && def != NULL ? def : string); + return (string); } /* |
