[Python-checkins] cpython (3.6): 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/70ae89898398
changeset:   105624:70ae89898398
branch:      3.6
parent:      105622:0ce789eae627
user:        Steve Dower <steve.dower at microsoft.com>
date:        Wed Dec 14 11:22:05 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