diff options
author | Dmitry Podgorny <pasis.ua@gmail.com> | 2013-08-03 13:17:50 +0300 |
---|---|---|
committer | Dmitry Podgorny <pasis.ua@gmail.com> | 2013-08-03 13:17:50 +0300 |
commit | c559d96d7739d499f9b747839e1115d28976306f (patch) | |
tree | 7784646790dcefe3854f4c347712f051825875d0 | |
parent | 51b2137705b99ad45a8d4d646da9f3f8e2b3b4db (diff) | |
download | profani-tty-c559d96d7739d499f9b747839e1115d28976306f.tar.gz |
removed sizeof(char)
sizeof(char) == 1 according to standard
-rw-r--r-- | src/command/command.c | 2 | ||||
-rw-r--r-- | src/tools/autocomplete.c | 4 | ||||
-rw-r--r-- | src/ui/statusbar.c | 2 | ||||
-rw-r--r-- | src/ui/titlebar.c | 10 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/command/command.c b/src/command/command.c index 45086e18..1017b899 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -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); diff --git a/src/tools/autocomplete.c b/src/tools/autocomplete.c index 0c56cac7..8426de85 100644 --- a/src/tools/autocomplete.c +++ b/src/tools/autocomplete.c @@ -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); diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c index 3f0798d3..cd218e73 100644 --- a/src/ui/statusbar.c +++ b/src/ui/statusbar.c @@ -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); diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c index 4b3ca997..791a5fbe 100644 --- a/src/ui/titlebar.c +++ b/src/ui/titlebar.c @@ -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); } |