From b812018652eec692e683dc2242830db99c2fd86a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 19 Oct 2006 07:32:18 +0000 Subject: [PATCH] * lib/strftime.c (advance): New macro. (add): Use it to avoid adding 0 to a FILE *. FILE can be an incomplete type, so you can't add 0 to it. Problem reported by Eelco Dolstra for dietlibc. --- ChangeLog | 7 +++++++ lib/strftime.c | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f86a64e5c7..773c3bdc3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-10-19 Paul Eggert + + * lib/strftime.c (advance): New macro. + (add): Use it to avoid adding 0 to a FILE *. FILE can be + an incomplete type, so you can't add 0 to it. Problem reported + by Eelco Dolstra for dietlibc. + 2006-10-18 Jim Meyering * lib/readutmp.c (desirable_utmp_entry): Use "bool" as the diff --git a/lib/strftime.c b/lib/strftime.c index ffa51c0cc3..d24b4cade9 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -181,6 +181,12 @@ extern char *tzname[]; # define memset_zero(P, Len) (memset (P, '0', Len), (P) += (Len)) #endif +#if FPRINTFTIME +# define advance(P, N) +#else +# define advance(P, N) ((P) += (N)) +#endif + #define add(n, f) \ do \ { \ @@ -199,7 +205,7 @@ extern char *tzname[]; memset_space (p, _delta); \ } \ f; \ - p += FPRINTFTIME ? 0 : _n; \ + advance (p, _n); \ } \ i += _incr; \ } while (0) -- 2.30.2