Skip to content

Commit af20923

Browse files
mdsninsramsey
authored andcommitted
Fix datetime format string to follow POSIX spec in ftp_mdtm()
Closes GH-8259
1 parent 418ba5b commit af20923

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ PHP NEWS
3030
. Added support for listening queue on macOS. (David Carlier)
3131
. Changed default for listen.backlog on Linux to -1. (Cristian Rodríguez)
3232

33+
- FTP:
34+
. Fix datetime format string to follow POSIX spec in ftp_mdtm(). (Jihwan Kim)
35+
3336
- Intl:
3437
. Update all grandfathered language tags with preferred values
3538
. Fixed GH-7939 (Cannot unserialize IntlTimeZone objects). (cmb)

ext/ftp/ftp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ ftp_mdtm(ftpbuf_t *ftp, const char *path, const size_t path_len)
11451145
}
11461146
/* parse out the timestamp */
11471147
for (ptr = ftp->inbuf; *ptr && !isdigit(*ptr); ptr++);
1148-
n = sscanf(ptr, "%4u%2u%2u%2u%2u%2u", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec);
1148+
n = sscanf(ptr, "%4d%2d%2d%2d%2d%2d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec);
11491149
if (n != 6) {
11501150
return -1;
11511151
}

0 commit comments

Comments
 (0)