From: Jens Axboe Date: Tue, 25 Sep 2012 07:56:37 +0000 (+0200) Subject: gfio: color parse stack removal X-Git-Tag: fio-2.1~57^2~52 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=26b0b19d46891d71806c103190cdd895cd873867;p=fio.git gfio: color parse stack removal Signed-off-by: Jens Axboe --- diff --git a/gfio.c b/gfio.c index d1cf346b..e44a599e 100644 --- a/gfio.c +++ b/gfio.c @@ -1349,13 +1349,13 @@ static void combo_entry_destroy(GtkWidget *widget, gpointer data) static void fill_color_from_rgb(GdkColor *c, gfloat r, gfloat g, gfloat b) { gint R, G, B; - gchar tmp[32]; + gchar tmp[8]; memset(c, 0, sizeof(*c)); R = r * 255; G = g * 255; B = b * 255; - sprintf(tmp, "#%02x%02x%02x", R, G, B); + snprintf(tmp, sizeof(tmp), "#%02x%02x%02x", R, G, B); gdk_color_parse(tmp, c); }