[Python-checkins] cpython (merge 3.6 -> default): Fixes maximum usable length of buffer for formatting time zone in localtime().

steve.dower python-checkins at python.org
Wed Dec 14 14:22:32 EST 2016


https://hg.python.org/cpython/rev/5a61c1bc3df9
changeset:   105625:5a61c1bc3df9
parent:      105623:09a8ee0f7585
parent:      105624:70ae89898398
user:        Steve Dower <steve.dower at microsoft.com>
date:        Wed Dec 14 11:22:14 2016 -0800
summary:
  Fixes maximum usable length of buffer for formatting time zone in localtime().

files:
  Modules/timemodule.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Modules/timemodule.c b/Modules/timemodule.c
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -398,7 +398,7 @@
         struct tm local = buf;
         char zone[100];
         int gmtoff;
-        strftime(zone, sizeof(buf), "%Z", &buf);
+        strftime(zone, sizeof(zone), "%Z", &buf);
         gmtoff = timegm(&buf) - when;
         return tmtotuple(&local, zone, gmtoff);
     }

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list