gfio: color parse stack removal
[fio.git] / gfio.c
diff --git a/gfio.c b/gfio.c
index d1cf346b0ede1bd80ac472999d645305a94e9cc8..e44a599e416e844ff8abdb12d97f08341a2b311d 100644 (file)
--- 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);
 }