summaryrefslogtreecommitdiffstats
path: root/misc-utils/cal.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc-utils/cal.c')
-rw-r--r--misc-utils/cal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 21ae6c6..e6f4a6e 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -692,9 +692,9 @@ static void headers_init(struct cal_control *ctl)
for (i = 0; i < DAYS_IN_WEEK; i++) {
size_t space_left;
- if (i)
- strcat(cur_dh++, " ");
space_left = sizeof(day_headings) - (cur_dh - day_headings);
+ if (i && space_left)
+ strncat(cur_dh++, " ", space_left--);
if (space_left <= (ctl->day_width - 1))
break;
@@ -1296,8 +1296,8 @@ static void __attribute__((__noreturn__)) usage(void)
" %s\n", USAGE_COLORS_DEFAULT);
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(23));
- printf(USAGE_MAN_TAIL("cal(1)"));
+ fprintf(out, USAGE_HELP_OPTIONS(23));
+ fprintf(out, USAGE_MAN_TAIL("cal(1)"));
exit(EXIT_SUCCESS);
}