summaryrefslogtreecommitdiff
path: root/strftime.c
diff options
context:
space:
mode:
authorStuart Bishop <stuart@stuartbishop.net>2021-09-26 18:24:53 +1000
committerStuart Bishop <stuart@stuartbishop.net>2021-09-26 18:24:53 +1000
commit16e9f021eff80d257f1ba56b9de2d79998eb785a (patch)
tree6bdb4e04d0acf2a871ec46fe642b4d7e6c96971d /strftime.c
parentd4d703b63bfbabdfe6184f0dc562605b96fd39fc (diff)
downloadpytz-git-16e9f021eff80d257f1ba56b9de2d79998eb785a.tar.gz
Squashed 'tz/' changes from 336c8f82..ded47180
9ffa3f6e Release 2021b a82f0264 Revert most of the recent alike-since-1970 changes 39df8c8b Jordan now starts DST on February’s last Thursday. 4d9c19d3 Improve ‘backward’ comment 0291a2da , → . 70676ba0 Revert May patch to zone.tab 29583c46 Samoa no longer observes DST 74ae3bc0 tzfile.5: s/only/& if/ (thanks to Andreas Schwab) ce8c77c0 Match RFC 8536bis-01 better 2ae4e0a4 Improve leap second table truncation doc df12babf Don't mistruncate TZif files at leap seconds b73f9fd0 Niue left -11:20 in 1964, not 1978 6ea18d5d Further flesh out commentary on Tonga 1961 change 7b5bf2a7 * NEWS: Fix typo describing zic's old boundary behvaior 59885b2f Document more background of rolling leap seconds 56da1f2a Document background of rolling leap seconds 9fee4ab4 zic -r is incompatible with rolling leaps 93132d18 Simplify zic's handling of -r 4170b91a Fix tzfile.5 miswording (thanks to Tim Parenti). 88d6ecd1 Improve wording about ambiguous leapsec fix a8684010 Use https: for opengroup in zic.8 584c0caf Port ‘check_time_t_alternatives’ to oddball hosts 83b95809 Fix ambiguous leapsecs by rolling up to a minute 1103a989 Omit some casts 96912bb3 Fix tzfile.h comment f5a55467 Change is_digit from macro to function bb938549 Relax leap-second pickiness ffe80a11 White space fixes 9296ea52 Mention time-tzdb and Timezone Database Explorer 5c79ca1f * Makefile: Document HAVE_MALLOC_ERRNO. d9b36430 Port to platforms where malloc does not set errno 7e8b7b5f Remove some lint found by GCC, Clang 7f74206b No leap second on 2021-12-31 127c537f Do not include sys/wait.h 7e13dc91 * tz-link.html: Update Android URL (thanks to Almaz Mingaleev). 9078a117 * tz-link.html: Mention @tubular/time’s new features. bdb8bb35 Check backzone syntax too a56b8796 * northamerica: Comment on Attu+Kiska 1942/3. 856a3dbf Replace Pacific/Enderbury with Pacific/Kanton e216b1c7 Don’t merge Etc/* with location-based names 1edbb16e Merge timezones that are alike since 1970 1facc7dc Mention ustar compatibility issue a7166005 * asia: Add Phillipine Time URL (thanks to P Chan). 27e8b84a Improve timezone location wording 48da91fc Consistently mark DST with <abbr>. 6860c875 Fix north Vietnam lat+long e8dd9a81 Sort “Bahamas” and “Gambia” better 2e6a2c83 Omit duplicate Link lines in ziguard output 59dda9ec Avoid backward links in zone.tab b41f96f0 Definite article for Bahamas, Gambia 75923a4a * NEWS: Mention intercontinental moves too. e7ba9e60 * Europe: Add Kosovo comment. 2a18a625 Move several compatibilty links to 'backward' a09458e1 Loosen zone.tab checking for links 9196f0b9 Fix zdump bug on !TM_ZONE platforms a1654178 * tz-link.html: Mention @tubular/time’s atomic-time support. e0920a67 Fix potential integer overflow in differ_by_repeat 749e3641 Do not assume bytes have 8 bits b007536d Do not assume negative >> behavior 4f14643b Do not assume unsigned->signed conversion style 80af1c6b * CONTRIBUTING, NEWS: Mention SECURITY. 47486561 * SECURITY: New file. cff3c806 Undef RESERVE_STD_EXT_IDS in zic 9970ac68 Include signal.h in zic 782bee5a * tz-link.html: Cite Mani et al. (Thanks to Brian Inglis.) 6010bddd Be consistent about no space between function and ‘(’. a10451bb More pre-1978 fixes for Cook and Niue bf12c3ba Cook Islands had two Christmases in 1899 e13cc88a Fix ‘make check_time_t_alternatives’ 8cf5b1c9 Restore simpler delta_nonneg code. ac07b446 Improve zdump -v tm_year extrema display 29a09598 zic -v now shows extreme-int tm_year transitions b73daeca Fix more overflow issues with extreme timestamps 6d06a8e2 Improve fix for localtime bug with slim leaps c66cffac Simplify zic integer arithmetic b4702636 Fix and simplify year-cycle reduction 94a218e4 Avoid arithmetic overflow in ‘hunt’ de601fa7 * tzfile.5: Fix prefix/suffix typo (thanks to Ian Abbott). 7dd8faba * NEWS: Fix "no longer" dup (thanks to Antonio Diaz Diaz). 2ff9a85f Improve coverage of version 4 interoperability 61d80384 Document time zone designations better 62b9467e Port zdump to right_only installations fc3520d4 Fix localtime bug with slim TZif files with leaps 5f7a3761 Simplify tzparse by removing LASTDITCH b4e84922 Fix leap second expiry and truncation c9abf630 Fix unlikely Y2038 leap second bug 7da612a2 Don’t oversize leapcorr a502f020 localtime.c is less finicky about leap seconds 3f949ece Rename branch "master" to "main" efac9ad4 No zic -L truncation due to leapseconds Expires 7e09da94 Omit some no-longer-live packages 03cc9897 Tonga switched to standard time in 1945, not 1901 686a57d3 Mention the Temporal proposal for ECMAScript (thanks to Jason Williams). 666022ef Tonga moved from +12:20 to +13 in 1961, not 1941 6982e34a Sierra Leone did not use DST 1957-1962 dd91b663 * africa: Fix placement of South Sudan comment. e31efcea zdump now uses [lo,hi) for both -c and -t 260665dd Improve localtime performance 75ce6a21 Update list of JavaScript libraries 601ddb2d * zic.c: Fix comment typo (thanks to Clive D.W. Feather). 8c5464fc Clean up temp files better 04765384 Update each zic output file atomically f6a87d40 Omit unnecessary assignments in zic.c 3d6af557 Mention more POSIXRULES bugs af187ed2 Don't cite Howse where no longer used bdb47c5f Backzone fixes for Gambia, Malawi, Sierra Leone 42efb563 Add Barbados DST 1942-1944, fix end of LMT 0252f09c Fix Guyana LMT and later historical transitions fe210b68 Fixups for today’s patches 93256f8c Fix integer overflow with TZ="EST5EDT4,0/0,J365/0" 9a064b1a Fix crash with TZ="EST5EDT4,0/0,J365/25" 0e0e810a Conform to POSIX for all-year DST in TZ strings f3f1a1c1 Avoid use of local statics 0c64fd71 Update GCC options for GCC 10 93a4099a Remove unused C macros 7fe1b0ac Clarify GCC pacification in previous fix 7b4808db Fix bug in last time type of Asia/Gaza etc. ed2f9d6b Portugal observed DST in 1950 git-subtree-dir: tz git-subtree-split: ded47180906e407829d26d0aee614d4ce7fffd2f
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/strftime.c b/strftime.c
index 4f871cd..5273155 100644
--- a/strftime.c
+++ b/strftime.c
@@ -335,11 +335,13 @@ label:
&& tm.tm_sec == tm_1.tm_sec))
return NULL;
}
- if (TYPE_SIGNED(time_t))
- sprintf(buf, "%"PRIdMAX,
- (intmax_t) mkt);
- else sprintf(buf, "%"PRIuMAX,
- (uintmax_t) mkt);
+ if (TYPE_SIGNED(time_t)) {
+ intmax_t n = mkt;
+ sprintf(buf, "%"PRIdMAX, n);
+ } else {
+ uintmax_t n = mkt;
+ sprintf(buf, "%"PRIuMAX, n);
+ }
pt = _add(buf, pt, ptlim);
}
continue;