diff options
author | imp <imp@FreeBSD.org> | 1997-03-02 20:07:37 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1997-03-02 20:07:37 +0000 |
commit | d2c38048672b344f29eccb91824efec5883c9b2c (patch) | |
tree | 6e409e7f781946b9818e2616134f1ef08d87e5b4 | |
parent | 914ff23b933ff3101973d357c711aa9218590447 (diff) | |
download | FreeBSD-src-d2c38048672b344f29eccb91824efec5883c9b2c.zip FreeBSD-src-d2c38048672b344f29eccb91824efec5883c9b2c.tar.gz |
Pendantic change of null to NUL. Also warn that this function does not
NUL terminate in the case of buffer overflow.
-rw-r--r-- | lib/libc/stdtime/strftime.3 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libc/stdtime/strftime.3 b/lib/libc/stdtime/strftime.3 index 9a1f2d5..0ff3ad7 100644 --- a/lib/libc/stdtime/strftime.3 +++ b/lib/libc/stdtime/strftime.3 @@ -66,13 +66,19 @@ and one other character. .Pp No more than .Fa maxsize -characters will be placed into the array. +characters will be placed into the array. If more characters than +.Fa maxsize +could have been written into +.Fa buf +then +.Fa bug +will not be NUL terminated. If the total number of resulting characters, including the terminating -null character, is not more than +NUL character, is not more than .Fa maxsize , .Fn strftime returns the number of characters in the array, not counting the -terminating null. +terminating NUL. Otherwise, zero is returned. .Pp Each conversion specification is replaced by the characters as |