]> err.no Git - mapper/commitdiff
Use g_snprintf
authorKaj-Michael Lang <milang@onion.tal.org>
Tue, 15 Jan 2008 15:01:16 +0000 (17:01 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Tue, 15 Jan 2008 15:01:16 +0000 (17:01 +0200)
src/config-gconf.c
src/db.c
src/gpx.c
src/route.c

index a7e0283832270f858d33a0b1f4d4a3382f01ffe6..71dfa1b209d9833b1866a2448df1760da66041b1 100644 (file)
@@ -116,7 +116,7 @@ for (curr = _repo_list; curr != NULL; curr = curr->next) {
         */
        RepoData *rd = curr->data;
        gchar buffer[BUFFER_SIZE];
-       snprintf(buffer, sizeof(buffer),
+       g_snprintf(buffer, sizeof(buffer),
                 "%s\t%s\t%s\t%d\t%d\t%d\t%d",
                 rd->name,
                 rd->url,
@@ -344,7 +344,7 @@ gconf_client_set_int(gconf_client, GCONF_KEY_ROUTE_DL_RADIUS, _route_dl_radius,
 
 /* Save Colors. */
 for (i = 0; i < COLORABLE_ENUM_COUNT; i++) {
-       snprintf(buffer, sizeof(buffer), "#%02x%02x%02x",
+       g_snprintf(buffer, sizeof(buffer), "#%02x%02x%02x",
                 _color[i].red >> 8, _color[i].green >> 8, _color[i].blue >> 8);
        gconf_client_set_string(gconf_client, COLORABLE_GCONF[i], buffer, NULL);
 }
index b966f8be426425e48e55978c10a1a5d0ace044cc..308129522d2639568e50f4ee32f79ac784a07df3 100644 (file)
--- a/src/db.c
+++ b/src/db.c
@@ -39,7 +39,7 @@ gchar **pszResult;
 guint nRow, nColumn;
 gchar sql[64];
 
-snprintf(sql, sizeof(sql),"select count(*) from %s", table);
+g_snprintf(sql, sizeof(sql),"select count(*) from %s", table);
 
 if (SQLITE_OK != sqlite3_get_table(db, sql, &pszResult, &nRow, &nColumn, NULL))
        return FALSE;
index bafb0129ca01cdb97a2a32c95ac0ec4e976b85d1..0f96859b84d4059f50a990518741e9128177e3b8 100644 (file)
--- a/src/gpx.c
+++ b/src/gpx.c
@@ -66,7 +66,7 @@
                     handle, (string), strlen((string)), &size))) \
     { \
         gchar buffer[BUFFER_SIZE]; \
-        snprintf(buffer, sizeof(buffer), \
+        g_snprintf(buffer, sizeof(buffer), \
                 "%s:\n%s\n%s", _("Error while writing to file"), \
                 _("File is incomplete."), \
                 gnome_vfs_result_to_string(vfs_result)); \
@@ -110,7 +110,7 @@ time_t time1;
 struct tm time2;
 time1 = time(NULL);
 localtime_r(&time1, &time2);
-snprintf(XML_TZONE, sizeof(XML_TZONE), "%+03ld:%02ld",
+g_snprintf(XML_TZONE, sizeof(XML_TZONE), "%+03ld:%02ld",
         (time2.tm_gmtoff / 60 / 60), (time2.tm_gmtoff / 60) % 60);
 }
 
index afb73c03374f3f72ba26767d57ed396003451da6..33a1b6bda9b54280299666aa1d97b17cd74822a1 100644 (file)
@@ -138,7 +138,7 @@ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle))) {
                gchar strlon[32];
                g_ascii_formatd(strlat, 32, "%.06f", _gps.lat);
                g_ascii_formatd(strlon, 32, "%.06f", _gps.lon);
-               snprintf(buffer, sizeof(buffer), "%s, %s", strlat, strlon);
+               g_snprintf(buffer, sizeof(buffer), "%s, %s", strlat, strlon);
                gtk_entry_set_text(GTK_ENTRY(oti->txt_from), buffer);
        } else if (toggle == oti->rad_use_route) {
                gchar buffer[80];
@@ -154,7 +154,7 @@ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle))) {
                unit2latlon(p->unitx, p->unity, lat, lon);
                g_ascii_formatd(strlat, 32, "%.06f", lat);
                g_ascii_formatd(strlon, 32, "%.06f", lon);
-               snprintf(buffer, sizeof(buffer), "%s, %s", strlat, strlon);
+               g_snprintf(buffer, sizeof(buffer), "%s, %s", strlat, strlon);
                gtk_entry_set_text(GTK_ENTRY(oti->txt_from), buffer);
        }
        gtk_widget_set_sensitive(oti->txt_from, toggle == oti->rad_use_text);
@@ -399,7 +399,7 @@ while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
 
        from_escaped = gnome_vfs_escape_string(from);
        to_escaped = gnome_vfs_escape_string(to);
-       snprintf(buffer, sizeof(buffer), source_url, from_escaped, to_escaped);
+       g_snprintf(buffer, sizeof(buffer), source_url, from_escaped, to_escaped);
        g_free(from_escaped);
        g_free(to_escaped);