# HG changeset patch # User Paul Eggert # Date 906759623 0 # Node ID 0800a4f8475751c02c6ca3340755ffb8151fc87d # Parent 26cc35857be5cac60918b961738dc588c44000d6 (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 -r 26cc35857be5 -r 0800a4f84757 src/strftime.c --- a/src/strftime.c Fri Sep 25 20:30:42 1998 +0000 +++ b/src/strftime.c Fri Sep 25 21:40:23 1998 +0000 @@ -742,8 +742,9 @@ *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); }