From 8432d4dd4a00d9a471fab4a8366f2cfc478a6015 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Wed, 11 Jul 2001 15:14:45 +0000 Subject: [PATCH] * gdialogs.c: Use g_snprintf() instead of snprintf(). * gnome-file-property-dialog.c: Likewise. * gprefs.c: Likewise. --- gnome/ChangeLog | 6 ++++++ gnome/gdialogs.c | 6 +++--- gnome/gnome-file-property-dialog.c | 10 +++++----- gnome/gprefs.c | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 4289ef9c7..d16974335 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,9 @@ +2001-07-11 Pavel Roskin + + * gdialogs.c: Use g_snprintf() instead of snprintf(). + * gnome-file-property-dialog.c: Likewise. + * gprefs.c: Likewise. + 2001-07-10 Pavel Roskin * gscreen.c (panel_icon_list_select_icon): This function doesn't diff --git a/gnome/gdialogs.c b/gnome/gdialogs.c index ad7e32abf..53bb7e443 100644 --- a/gnome/gdialogs.c +++ b/gnome/gdialogs.c @@ -244,7 +244,7 @@ file_progress_show (FileOpContext *ctx, long done, long total) if (total > 0) { perc = (double) done / (double) total; - snprintf (count, 9, "%3d%% ", (gint) (100.0 * perc)); + g_snprintf (count, 9, "%3d%% ", (gint) (100.0 * perc)); gtk_label_set_text (GTK_LABEL (ui->file_label), count); } while (gtk_events_pending ()) @@ -269,7 +269,7 @@ file_progress_show_count (FileOpContext *ctx, long done, long total) if (ui->aborting) return FILE_ABORT; - snprintf (count, 100, "%ld/%ld ", done, total); + g_snprintf (count, 100, "%ld/%ld ", done, total); gtk_label_set_text (GTK_LABEL (ui->count_label), count); while (gtk_events_pending ()) gtk_main_iteration (); @@ -484,7 +484,7 @@ file_progress_real_query_replace (FileOpContext *ctx, enum OperationMode mode, c GNOME_STOCK_BUTTON_CANCEL, NULL); gtk_window_set_position (GTK_WINDOW (qr_dlg), GTK_WIN_POS_MOUSE); - snprintf (msg, sizeof (msg)-1, _("The target file already exists: %s"), destname); + g_snprintf (msg, sizeof (msg)-1, _("The target file already exists: %s"), destname); label = gtk_label_new (msg); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); diff --git a/gnome/gnome-file-property-dialog.c b/gnome/gnome-file-property-dialog.c index 60dccf4ce..6d2fa4ec8 100644 --- a/gnome/gnome-file-property-dialog.c +++ b/gnome/gnome-file-property-dialog.c @@ -244,17 +244,17 @@ create_general_properties (GnomeFilePropertyDialog *fp_dlg) || S_ISREG (fp_dlg->st.st_mode) || S_ISLNK (fp_dlg->st.st_mode)) { if ((gint)fp_dlg->st.st_size < 1024) { - snprintf (buf, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size); + g_snprintf (buf, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size); gen_string = g_strconcat (_("File Size: "), buf, _(" bytes"), NULL); } else if ((gint)fp_dlg->st.st_size < 1024 * 1024) { - snprintf (buf, MC_MAXPATHLEN, "%.1f", (gfloat) fp_dlg->st.st_size / 1024.0); - snprintf (buf2, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size); + g_snprintf (buf, MC_MAXPATHLEN, "%.1f", (gfloat) fp_dlg->st.st_size / 1024.0); + g_snprintf (buf2, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size); gen_string = g_strconcat (_("File Size: "), buf, _(" KBytes ("), buf2, _(" bytes)"), NULL); } else { - snprintf (buf, MC_MAXPATHLEN, "%.1f", + g_snprintf (buf, MC_MAXPATHLEN, "%.1f", (gfloat) fp_dlg->st.st_size / (1024.0 * 1024.0)); - snprintf (buf2, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size); + g_snprintf (buf2, MC_MAXPATHLEN, "%d", (gint) fp_dlg->st.st_size); gen_string = g_strconcat (_("File Size: "), buf, _(" MBytes ("), buf2, _(" bytes)"), NULL); } diff --git a/gnome/gprefs.c b/gnome/gprefs.c index d708a5794..9eab3c99e 100644 --- a/gnome/gprefs.c +++ b/gnome/gprefs.c @@ -378,7 +378,7 @@ create_prop_int (PrefsDlg *dlg, Property *prop) entry = gnome_entry_new (_(prop->label)); - snprintf (buffer, 9, "%d", *( (int*) prop->property_variable)); + g_snprintf (buffer, 9, "%d", *( (int*) prop->property_variable)); gtk_entry_set_text (GTK_ENTRY (gnome_entry_gtk_entry (GNOME_ENTRY (entry))), buffer);