Skip to content

Commit

Permalink
Avoid warning for strncat.
Browse files Browse the repository at this point in the history
  • Loading branch information
t8m committed Oct 31, 2019
1 parent 979ca4a commit f531f01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions anacron/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ make_msg(const char *fmt, va_list args)
* returns when the buffer overflows. Hmmm... */
len = vsnprintf(msg, sizeof(msg), fmt, args);
if (len < 0) {
msg[0] = '\0';
strncat(msg, "(vsnprintf failed)", sizeof(msg));
strncpy(msg, "(vsnprintf failed)", sizeof(msg));
msg[sizeof(msg) - 1] = '\0';
return;
}
if ((size_t) len >= sizeof(msg) - 1)
Expand Down

0 comments on commit f531f01

Please sign in to comment.