1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 22:06:38 +02:00

Use of sizeof(char) in all malloc/realloc for strings

This commit is contained in:
Sebastien Helleu
2008-02-02 21:12:16 +01:00
parent d7cc27f713
commit 28e811c09c
38 changed files with 99 additions and 239 deletions
+4 -4
View File
@@ -844,8 +844,8 @@ script_api_config_get_plugin (struct t_weechat_plugin *weechat_plugin,
{
char *option_fullname, *return_value;
option_fullname = (char *)malloc (strlen (script->name) +
strlen (option) + 2);
option_fullname = (char *)malloc ((strlen (script->name) +
strlen (option) + 2) * sizeof (char));
if (!option_fullname)
return NULL;
@@ -872,8 +872,8 @@ script_api_config_set_plugin (struct t_weechat_plugin *weechat_plugin,
char *option_fullname;
int return_code;
option_fullname = (char *)malloc (strlen (script->name) +
strlen (option) + 2);
option_fullname = (char *)malloc ((strlen (script->name) +
strlen (option) + 2) * sizeof (char));
if (!option_fullname)
return 0;