From: Paul Eggert Date: Fri, 25 Sep 1998 21:40:23 +0000 (+0000) Subject: (underlying_strftime): X-Git-Tag: emacs-20.4~1626 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=08b4600264d34e34f62ad1a32c7e355ab9cc315d;p=emacs.git (underlying_strftime): Set the buffer to a nonzero value before calling strftime, and check to see whether strftime has set the buffer to zero. This lets us distinguish between an empty buffer and an error. I'm installing this patch by hand now; it will be superseded whenever the glibc sources are propagated back to fsf.org. --- diff --git a/src/strftime.c b/src/strftime.c index de5e6b74af9..ec6068a3b28 100644 --- a/src/strftime.c +++ b/src/strftime.c @@ -742,8 +742,9 @@ my_strftime (s, maxsize, format, tp) *u++ = modifier; *u++ = format_char; *u = '\0'; + ubuf[0] = '\1'; len = strftime (ubuf, sizeof ubuf, ufmt, tp); - if (len == 0) + if (len == 0 && ubuf[0] != '\0') return 0; cpy (len, ubuf); }