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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user