mirror of
https://github.com/simon987/antiword.git
synced 2025-04-04 07:53:00 +00:00
Use snprintf() when converting dates to strings
This commit is contained in:
parent
0d5bf64ccf
commit
9716b79062
@ -729,7 +729,7 @@ szGetLastSaveDtm(void)
|
||||
if (pTime == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
sprintf(szTime, "%04d-%02d-%02d",
|
||||
snprintf(szTime, sizeof(szTime), "%04d-%02d-%02d",
|
||||
pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday);
|
||||
return szTime;
|
||||
} /* end of szGetLastSaveDtm */
|
||||
@ -750,7 +750,7 @@ szGetModDate(void)
|
||||
if (pTime == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
sprintf(szTime, "D:%04d%02d%02d%02d%02d",
|
||||
snprintf(szTime, sizeof(szTime), "D:%04d%02d%02d%02d%02d",
|
||||
pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday,
|
||||
pTime->tm_hour, pTime->tm_min);
|
||||
return szTime;
|
||||
@ -772,7 +772,7 @@ szGetCreationDate(void)
|
||||
if (pTime == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
sprintf(szTime, "D:%04d%02d%02d%02d%02d",
|
||||
snprintf(szTime, sizeof(szTime), "D:%04d%02d%02d%02d%02d",
|
||||
pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday,
|
||||
pTime->tm_hour, pTime->tm_min);
|
||||
return szTime;
|
||||
|
Loading…
x
Reference in New Issue
Block a user