Coverity fixes
authorNelson Ferreira <nelson.ferreira@ieee.org>
Sun, 2 Oct 2011 21:04:49 +0000 (17:04 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Sun, 2 Oct 2011 21:04:49 +0000 (17:04 -0400)
* src/ui/Gtk/objects-gtk.c (gtk_print_color_instance): use
write_fmt_str instead of sprintf.

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/ui/Gtk/objects-gtk.c

index 2c9af09..a4533b9 100644 (file)
@@ -135,11 +135,9 @@ static void
 gtk_print_color_instance(struct Lisp_Color_Instance *c,
                         Lisp_Object printcharfun, int escapeflag)
 {
-       char buf[100];
        GdkColor *color = COLOR_INSTANCE_GTK_COLOR(c);
-       sprintf(buf, " %ld=(%X,%X,%X)",
-               color->pixel, color->red, color->green, color->blue);
-       write_c_string(buf, printcharfun);
+       write_fmt_str(printcharfun, " %ld=(%X,%X,%X)",
+                     color->pixel, color->red, color->green, color->blue);
 }
 
 static void gtk_finalize_color_instance(struct Lisp_Color_Instance *c)
@@ -305,10 +303,8 @@ static void
 gtk_print_font_instance(struct Lisp_Font_Instance *f,
                        Lisp_Object printcharfun, int escapeflag)
 {
-       char buf[200];
-       sprintf(buf, " 0x%lx",
-               (unsigned long)gdk_font_id(FONT_INSTANCE_GTK_FONT(f)));
-       write_c_string(buf, printcharfun);
+       write_fmt_str(printcharfun, " 0x%lx",
+                     (unsigned long)gdk_font_id(FONT_INSTANCE_GTK_FONT(f)));
 }
 
 static void gtk_finalize_font_instance(struct Lisp_Font_Instance *f)