From 8c698dc63f765d4a5b3a49a25850c1738279d68d Mon Sep 17 00:00:00 2001 From: jdoubleu Date: Mon, 11 Apr 2022 13:10:38 +0200 Subject: [PATCH] debug print condition values of tz string name parsing --- newlib/libc/time/tzset_r.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/newlib/libc/time/tzset_r.c b/newlib/libc/time/tzset_r.c index 9cb30b188..e20a32a62 100644 --- a/newlib/libc/time/tzset_r.c +++ b/newlib/libc/time/tzset_r.c @@ -54,9 +54,11 @@ _tzset_unlocked_r (struct _reent *reent_ptr) ++tzenv; /* quit if no items, too few or too many chars, or no close quote '>' */ - if (sscanf (tzenv, "%10[-+0-9A-Za-z]%n", __tzname_std, &n) <= 0 - || n < TZNAME_MIN || TZNAME_MAX < n || '>' != tzenv[n]) + int res = sscanf (tzenv, "%10[-+0-9A-Za-z]%n", __tzname_std, &n); + if (res <= 0 || n < TZNAME_MIN || TZNAME_MAX < n || '>' != tzenv[n]) { + printf("parsing name: tzenv=\"%s\", res=%d, n=%d, tzenv[n] = %c\n", tzenv, res, n, tzenv[n]); return; + } ++tzenv; /* bump for close quote '>' */ } -- 2.35.1