Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1a7d9d

Browse files
committed
Closes #22568: fix UTIME_TO_* macros in posixmodule for rare cases.
1 parent 6b04dc9 commit e1a7d9d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Modules/posixmodule.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4714,25 +4714,25 @@ typedef struct {
47144714
} \
47154715

47164716
#define UTIME_TO_UTIMBUF \
4717-
struct utimbuf u[2]; \
4717+
struct utimbuf u; \
47184718
struct utimbuf *time; \
47194719
if (ut->now) \
47204720
time = NULL; \
47214721
else { \
4722-
u[0].actime = ut->atime_s; \
4723-
u[0].modtime = ut->mtime_s; \
4724-
time = u; \
4722+
u.actime = ut->atime_s; \
4723+
u.modtime = ut->mtime_s; \
4724+
time = &u; \
47254725
}
47264726

47274727
#define UTIME_TO_TIME_T \
47284728
time_t timet[2]; \
4729-
struct timet time; \
4729+
time_t *time; \
47304730
if (ut->now) \
47314731
time = NULL; \
47324732
else { \
47334733
timet[0] = ut->atime_s; \
47344734
timet[1] = ut->mtime_s; \
4735-
time = &timet; \
4735+
time = timet; \
47364736
} \
47374737

47384738

0 commit comments

Comments
 (0)