From 9fbe13c29e87d10938dd07cb57ac800bc3732a1e Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 31 Mar 1997 04:51:13 +0000 Subject: [PATCH] Revert my last few changes. They were bogus. Replaced them with the original text plus a statement saying that if strftime fails, the results are undefined. Requested a long time ago by: bde --- lib/libc/stdtime/strftime.3 | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/libc/stdtime/strftime.3 b/lib/libc/stdtime/strftime.3 index ba2d1a0ca60f..f3709fbdfc7d 100644 --- a/lib/libc/stdtime/strftime.3 +++ b/lib/libc/stdtime/strftime.3 @@ -66,24 +66,14 @@ and one other character. .Pp No more than .Fa maxsize -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 -.Sq Li \&\e0 -terminated. +characters will be placed into the array. If the total number of resulting characters, including the terminating -.Sq Li \&\e0 -character, is not more than +null character, is not more than .Fa maxsize , .Fn strftime returns the number of characters in the array, not counting the -terminating -.Sq Li \&\e0 . -Otherwise, zero is returned. +terminating null. +Otherwise, zero is returned and the contents of the buffer are undefined. .Pp Each conversion specification is replaced by the characters as follows which are then copied into the buffer.