[gtk+/gtk-3-20] Use g_snprintf instead of snprintf.



commit 67b294ef5d596d7c0e7ec7797bbb713bd934a24a
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Aug 10 12:29:01 2016 +0200

    Use g_snprintf instead of snprintf.
    
    snprintf is not compatible with msvc.

 gtk/gtkscale.c      |    5 +++--
 gtk/gtkspinbutton.c |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 60eed65..84290a5 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1850,12 +1850,13 @@ gtk_scale_real_get_layout_offsets (GtkScale *scale,
 }
 
 static gchar *
-weed_out_neg_zero (gchar *str, gint digits)
+weed_out_neg_zero (gchar *str,
+                   gint   digits)
 {
   if (str[0] == '-')
     {
       gchar neg_zero[8];
-      snprintf (neg_zero, 8, "%0.*f", digits, -0.0);
+      g_snprintf (neg_zero, 8, "%0.*f", digits, -0.0);
       if (strcmp (neg_zero, str) == 0)
         memmove (str, str + 1, strlen (str) - 1);
     }
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index c159f26..7ddaac6 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -1116,12 +1116,13 @@ measure_string_width (PangoLayout *layout,
 }
 
 static gchar *
-weed_out_neg_zero (gchar *str, gint digits)
+weed_out_neg_zero (gchar *str,
+                   gint   digits)
 {
   if (str[0] == '-')
     {
       gchar neg_zero[8];
-      snprintf (neg_zero, 8, "%0.*f", digits, -0.0);
+      g_snprintf (neg_zero, 8, "%0.*f", digits, -0.0);
       if (strcmp (neg_zero, str) == 0)
         memmove (str, str + 1, strlen (str) - 1);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]