]> granicus.if.org Git - python/commitdiff
Closes #22568: fix UTIME_TO_* macros in posixmodule for rare cases.
authorGeorg Brandl <georg@python.org>
Sun, 12 Oct 2014 06:45:15 +0000 (08:45 +0200)
committerGeorg Brandl <georg@python.org>
Sun, 12 Oct 2014 06:45:15 +0000 (08:45 +0200)
Modules/posixmodule.c

index 22770e86a68105444fd21b1307f87c61ebbde79c..e1e5af93d763f6db1981aea0f3f492cd52ab5ba5 100644 (file)
@@ -4714,25 +4714,25 @@ typedef struct {
     } \
 
 #define UTIME_TO_UTIMBUF \
-    struct utimbuf u[2]; \
+    struct utimbuf u; \
     struct utimbuf *time; \
     if (ut->now) \
         time = NULL; \
     else { \
-        u[0].actime = ut->atime_s; \
-        u[0].modtime = ut->mtime_s; \
-        time = u; \
+        u.actime = ut->atime_s; \
+        u.modtime = ut->mtime_s; \
+        time = &u; \
     }
 
 #define UTIME_TO_TIME_T \
     time_t timet[2]; \
-    struct timet time; \
+    time_t *time; \
     if (ut->now) \
         time = NULL; \
     else { \
         timet[0] = ut->atime_s; \
         timet[1] = ut->mtime_s; \
-        time = &timet; \
+        time = timet; \
     } \