Convert sprintf calls to snprintf. From pvaldes.

git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@448 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Tim Cava
2013-11-11 21:28:03 +00:00
parent c1530e9406
commit c7e6e5ea08

View File

@@ -110,7 +110,7 @@ void funny_print_widelist(void)
*buffer1 = '\0';
for (i = 1; i < wl_elements; i++)
{
sprintf(buffer2, "%s(%d) ", wide_list[i]->channel,
snprintf(buffer2, sizeof buffer2, "%s(%d) ", wide_list[i]->channel,
wide_list[i]->users);
ptr = strchr(buffer1, '\0');
if (strlen(buffer1) + strlen(buffer2) > current_term->TI_cols - 5)
@@ -149,11 +149,11 @@ void funny_list(char *from, char **ArgList)
if (last_width != get_int_var(CHANNEL_NAME_WIDTH_VAR))
{
if ((last_width = get_int_var(CHANNEL_NAME_WIDTH_VAR)) != 0)
snprintf(format, 25, "%%s %%-%u.%us %%-5s %%s", /*thing_ansi,*/
snprintf(format, sizeof format, "%%s %%-%u.%us %%-5s %%s", /*thing_ansi,*/
(unsigned char) last_width,
(unsigned char) last_width);
else
snprintf(format, 25, "%%s %%s %%-5s %%s"/*, thing_ansi*/);
snprintf(format, sizeof format, "%%s %%s %%-5s %%s"/*, thing_ansi*/);
}
channel = ArgList[0];
user_cnt = ArgList[1];
@@ -333,7 +333,7 @@ int user_count = 0;
if (last_width != get_int_var(CHANNEL_NAME_WIDTH_VAR))
{
if ((last_width = get_int_var(CHANNEL_NAME_WIDTH_VAR)) != 0)
sprintf(format, "%%s: %%-%u.%us %%s",
snprintf(format, sizeof format, "%%s: %%-%u.%us %%s",
(unsigned char) last_width,
(unsigned char) last_width);
else