1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

removed sizeof(char)

sizeof(char) == 1 according to standard
This commit is contained in:
Dmitry Podgorny 2013-08-03 13:17:50 +03:00
parent 51b2137705
commit c559d96d77
4 changed files with 9 additions and 9 deletions

View File

@ -1041,7 +1041,7 @@ cmd_autocomplete(char *input, int *size)
inp_cpy[i] = '\0';
found = autocomplete_complete(commands_ac, inp_cpy);
if (found != NULL) {
auto_msg = (char *) malloc((strlen(found) + 1) * sizeof(char));
auto_msg = (char *) malloc(strlen(found) + 1);
strcpy(auto_msg, found);
inp_replace_input(input, auto_msg, size);
free(auto_msg);

View File

@ -220,7 +220,7 @@ autocomplete_param_with_func(char *input, int *size, char *command,
inp_cpy[(*size) - len] = '\0';
found = func(inp_cpy);
if (found != NULL) {
auto_msg = (char *) malloc((len + (strlen(found) + 1)) * sizeof(char));
auto_msg = (char *) malloc(len + strlen(found) + 1);
strcpy(auto_msg, command_cpy);
strcat(auto_msg, found);
free(found);
@ -249,7 +249,7 @@ autocomplete_param_with_ac(char *input, int *size, char *command,
inp_cpy[(*size) - len] = '\0';
found = autocomplete_complete(ac, inp_cpy);
if (found != NULL) {
auto_msg = (char *) malloc((len + (strlen(found) + 1)) * sizeof(char));
auto_msg = (char *) malloc(len + strlen(found) + 1);
strcpy(auto_msg, command_cpy);
strcat(auto_msg, found);
free(found);

View File

@ -191,7 +191,7 @@ status_bar_print_message(const char * const msg)
werase(status_bar);
message = (char *) malloc((strlen(msg) + 1) * sizeof(char));
message = (char *) malloc(strlen(msg) + 1);
strcpy(message, msg);
mvwprintw(status_bar, 0, 10, message);

View File

@ -87,7 +87,7 @@ title_bar_refresh(void)
free(current_title);
}
current_title = (char *) malloc((strlen(recipient) + 1) * sizeof(char));
current_title = (char *) malloc(strlen(recipient) + 1);
strcpy(current_title, recipient);
title_bar_draw();
@ -113,7 +113,7 @@ title_bar_show(const char * const title)
if (current_title != NULL)
free(current_title);
current_title = (char *) malloc((strlen(title) + 1) * sizeof(char));
current_title = (char *) malloc(strlen(title) + 1);
strcpy(current_title, title);
_title_bar_draw_title();
}
@ -138,7 +138,7 @@ title_bar_set_recipient(const char * const from)
free(current_title);
}
current_title = (char *) malloc((strlen(from) + 1) * sizeof(char));
current_title = (char *) malloc(strlen(from) + 1);
strcpy(current_title, from);
dirty = TRUE;
@ -160,10 +160,10 @@ title_bar_set_typing(gboolean is_typing)
}
if (is_typing) {
current_title = (char *) malloc((strlen(recipient) + 13) * sizeof(char));
current_title = (char *) malloc(strlen(recipient) + 13);
sprintf(current_title, "%s (typing...)", recipient);
} else {
current_title = (char *) malloc((strlen(recipient) + 1) * sizeof(char));
current_title = (char *) malloc(strlen(recipient) + 1);
strcpy(current_title, recipient);
}