irc: fix size used in some snprintf

This commit is contained in:
Sebastien Helleu 2014-02-28 11:39:48 +01:00
parent 6ea8c2d83c
commit 82ade05f66
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ irc_info_create_string_with_pointer (char **string, void *pointer)
*string = malloc (64); *string = malloc (64);
if (*string) if (*string)
{ {
snprintf (*string, 64 - 1, "0x%lx", (long unsigned int)pointer); snprintf (*string, 64, "0x%lx", (long unsigned int)pointer);
} }
} }
} }

View File

@ -2000,7 +2000,7 @@ irc_server_send_one_msg (struct t_irc_server *server, int flags,
if (pos) if (pos)
pos[0] = '\0'; pos[0] = '\0';
snprintf (buffer, sizeof (buffer) - 1, "%s\r\n", ptr_msg); snprintf (buffer, sizeof (buffer), "%s\r\n", ptr_msg);
/* anti-flood: look whether we should queue outgoing message or not */ /* anti-flood: look whether we should queue outgoing message or not */
time_now = time (NULL); time_now = time (NULL);