Skip to content

Commit 2f1a6c4

Browse files
committed
Merge pull request #4871 from Komnomnomnom/iso-date-overflow
FIX: iso date encoding year overflow
2 parents 908007b + 808850f commit 2f1a6c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/src/datetime/np_datetime_strings.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
11481148
#ifdef _WIN32
11491149
tmplen = _snprintf(substr, sublen, "%04" NPY_INT64_FMT, dts->year);
11501150
#else
1151-
tmplen = snprintf(substr, sublen, "%04" NPY_INT64_FMT, (long int)dts->year);
1151+
tmplen = snprintf(substr, sublen, "%04" NPY_INT64_FMT, (long long)dts->year);
11521152
#endif
11531153
/* If it ran out of space or there isn't space for the NULL terminator */
11541154
if (tmplen < 0 || tmplen > sublen) {

0 commit comments

Comments
 (0)