mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 02:33:12 +02:00
Removed sizeof(char) and useless type casts from void* to another pointer type (patch from Leonid Evdokimov)
This commit is contained in:
@@ -75,8 +75,7 @@ plugin_config_search (char *plugin_name, char *option_name)
|
||||
char *internal_option;
|
||||
struct t_config_option *ptr_option;
|
||||
|
||||
internal_option = (char *)malloc ((strlen (plugin_name) +
|
||||
strlen (option_name) + 2) * sizeof (char));
|
||||
internal_option = malloc (strlen (plugin_name) + strlen (option_name) + 2);
|
||||
if (!internal_option)
|
||||
return NULL;
|
||||
|
||||
@@ -154,7 +153,7 @@ plugin_config_set_internal (char *option, char *value)
|
||||
{
|
||||
if (value && value[0])
|
||||
{
|
||||
ptr_option = (struct t_config_option *)malloc (sizeof (struct t_config_option));
|
||||
ptr_option = malloc (sizeof (*ptr_option));
|
||||
if (ptr_option)
|
||||
{
|
||||
/* create new option */
|
||||
@@ -223,8 +222,7 @@ plugin_config_set (char *plugin_name, char *option_name, char *value)
|
||||
char *internal_option;
|
||||
int return_code;
|
||||
|
||||
internal_option = (char *)malloc ((strlen (plugin_name) +
|
||||
strlen (option_name) + 2) * sizeof (char));
|
||||
internal_option = malloc (strlen (plugin_name) + strlen (option_name) + 2);
|
||||
if (!internal_option)
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user