mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 01:03:14 +02:00
Removed sizeof(char) and useless type casts from void* to another pointer type (patch from Leonid Evdokimov)
This commit is contained in:
@@ -78,12 +78,12 @@ alias_add_word (char **alias, int *length, char *word)
|
||||
|
||||
if (*alias == NULL)
|
||||
{
|
||||
*alias = (char *)malloc ((length_word + 1) * sizeof (char));
|
||||
*alias = malloc (length_word + 1);
|
||||
strcpy (*alias, word);
|
||||
}
|
||||
else
|
||||
{
|
||||
*alias = realloc (*alias, (strlen (*alias) + length_word + 1) * sizeof (char));
|
||||
*alias = realloc (*alias, strlen (*alias) + length_word + 1);
|
||||
strcat (*alias, word);
|
||||
}
|
||||
*length += length_word;
|
||||
@@ -218,7 +218,7 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
|
||||
weechat_command (buffer, args_replaced);
|
||||
else
|
||||
{
|
||||
alias_command = (char *)malloc ((1 + strlen(args_replaced) + 1) * sizeof (char));
|
||||
alias_command = malloc (1 + strlen(args_replaced) + 1);
|
||||
if (alias_command)
|
||||
{
|
||||
strcpy (alias_command, "/");
|
||||
@@ -238,7 +238,7 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
|
||||
length1 = strlen (*ptr_cmd);
|
||||
length2 = strlen (argv_eol[1]);
|
||||
|
||||
alias_command = (char *)malloc ((1 + length1 + 1 + length2 + 1) * sizeof (char));
|
||||
alias_command = malloc (1 + length1 + 1 + length2 + 1);
|
||||
if (alias_command)
|
||||
{
|
||||
if (*ptr_cmd[0] != '/')
|
||||
@@ -260,7 +260,7 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
|
||||
(void) weechat_command(buffer, *ptr_cmd);
|
||||
else
|
||||
{
|
||||
alias_command = (char *)malloc ((1 + strlen (*ptr_cmd) + 1) * sizeof (char));
|
||||
alias_command = malloc (1 + strlen (*ptr_cmd) + 1);
|
||||
if (alias_command)
|
||||
{
|
||||
strcpy (alias_command, "/");
|
||||
@@ -306,7 +306,7 @@ alias_new (char *name, char *command)
|
||||
return ptr_alias;
|
||||
}
|
||||
|
||||
new_alias = (struct t_alias *)malloc (sizeof (struct t_alias));
|
||||
new_alias = malloc (sizeof (*new_alias));
|
||||
if (new_alias)
|
||||
{
|
||||
new_hook = weechat_hook_command (name, "[alias]", NULL, NULL, NULL,
|
||||
|
||||
Reference in New Issue
Block a user