diff options
author | Paul Eggert <eggert@twinsun.com> | 1998-09-25 21:40:23 +0000 |
---|---|---|
committer | Paul Eggert <eggert@twinsun.com> | 1998-09-25 21:40:23 +0000 |
commit | 7bba6ffb090865720272b9702d610edd2b5f4264 (patch) | |
tree | f9de26ae489d223482b06b2f0944ffb3fe57cfeb /src/strftime.c | |
parent | bb8327b108c597b6b715f1e6efafd7899b93578e (diff) | |
download | emacs-7bba6ffb090865720272b9702d610edd2b5f4264.tar.gz |
(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.
Diffstat (limited to 'src/strftime.c')
-rw-r--r-- | src/strftime.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); } |