diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-02-02 21:12:16 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-02-02 21:12:16 +0100 |
commit | 28e811c09c5f32833906a5025137c947b2b7e0f6 (patch) | |
tree | 6a8357408cf85d16a6814a0bee2fbb5c57aa5919 /src/gui/curses/gui-curses-color.c | |
parent | d7cc27f713e02c2047f5d6085ec8e5d48b802522 (diff) | |
download | weechat-28e811c09c5f32833906a5025137c947b2b7e0f6.zip |
Use of sizeof(char) in all malloc/realloc for strings
Diffstat (limited to 'src/gui/curses/gui-curses-color.c')
-rw-r--r-- | src/gui/curses/gui-curses-color.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index cacb8ec46..dcd7428bb 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -228,7 +228,7 @@ gui_color_assign (t_gui_color **color, char *fg_and_bg) if (*color->string) free (*color->string); - *color->string = (char *)malloc (4); + *color->string = (char *)malloc (4 * sizeof (char)); if (*color->string) snprintf (*color->string, 4, "%s%02d", @@ -278,7 +278,7 @@ gui_color_build (int number, int foreground, int background) new_color->foreground = gui_weechat_colors[foreground].foreground; new_color->background = gui_weechat_colors[background].foreground; new_color->attributes = gui_weechat_colors[foreground].attributes; - new_color->string = (char *)malloc (4); + new_color->string = (char *)malloc (4 * sizeof (char)); if (new_color->string) snprintf (new_color->string, 4, "%s%02d", |