aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/listalf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/listalf.c b/src/listalf.c
index 2a06620..e94b95a 100644
--- a/src/listalf.c
+++ b/src/listalf.c
@@ -41,7 +41,7 @@ void format_msdos_time(char *buf) {
/* midnight and noon print as 12, not 0 */
if(hour == 0) hour = 12;
- sprintf(buf, "%2d:%02d%c", hour, min, ampm);
+ snprintf(buf, 7, "%2d:%02d%c", hour, min, ampm);
}
/* see Arcinfo for details */
@@ -61,7 +61,7 @@ void format_msdos_date(char *buf) {
/* valid day range is 1 to 31. 0 is invalid, print as-is. */
day = d & 0x1f;
- sprintf(buf, "%2d %3s %02d", day, monthnames[month], year);
+ snprintf(buf, 10, "%2d %3s %02d", day, monthnames[month], year);
}
/* small files may be "compressed" larger than the original, so this