diff --git a/lib/mu-container.c b/lib/mu-container.c index 05127218..d88ae85f 100644 --- a/lib/mu-container.c +++ b/lib/mu-container.c @@ -539,7 +539,7 @@ path_to_string (Path *p, const char* frmt) for (u = 0, str = NULL; p->_data[u] != 0; ++u) { char segm[16]; - snprintf (segm, sizeof(segm), frmt, p->_data[u] - 1); + g_snprintf (segm, sizeof(segm), frmt, p->_data[u] - 1); if (!str) str = g_strdup (segm); @@ -645,7 +645,7 @@ thread_segment_format_string (size_t matchnum) /* get the number of digits needed in a hex-representation of * matchnum */ digitnum = (unsigned) (ceil (log(matchnum)/log(16))); - snprintf (frmt, sizeof(frmt), "%%0%ux", digitnum); + g_snprintf (frmt, sizeof(frmt), "%%0%ux", digitnum); return frmt; } diff --git a/lib/mu-store.cc b/lib/mu-store.cc index 114cf57f..cf214746 100644 --- a/lib/mu-store.cc +++ b/lib/mu-store.cc @@ -306,7 +306,7 @@ Store::set_path_tstamp (const std::string& path, time_t tstamp) LOCKED; std::array data{}; - const std::size_t len = snprintf (data.data(), data.size(), "%x", tstamp); + const std::size_t len = g_snprintf (data.data(), data.size(), "%x", tstamp); priv_->writable_db()->set_metadata(path, std::string{data.data(), len}); } @@ -390,7 +390,7 @@ mutable_self (MuStore *store) static void hash_str (char *buf, size_t buf_size, const char *data) { - snprintf(buf, buf_size, "016%" PRIx64, mu_util_get_hash(data)); + g_snprintf(buf, buf_size, "016%" PRIx64, mu_util_get_hash(data)); } @@ -954,7 +954,7 @@ each_part (MuMsg *msg, MuMsgPart *part, PartData *pdata) /* save the mime type of any part */ if (part->type) { char ctype[MU_STORE_MAX_TERM_LENGTH + 1]; - snprintf(ctype, sizeof(ctype), "%s/%s", part->type, part->subtype); + g_snprintf(ctype, sizeof(ctype), "%s/%s", part->type, part->subtype); add_term(pdata->_doc, mime + ctype); } diff --git a/lib/mu-threader.c b/lib/mu-threader.c index ec163e5c..80857ef0 100644 --- a/lib/mu-threader.c +++ b/lib/mu-threader.c @@ -166,7 +166,7 @@ find_or_create (GHashTable *id_table, MuMsg *msg, guint docid) msgid = mu_msg_get_path (msg); /* fake it */ if (!msgid) { /* no path either? seems to happen... */ g_warning ("message without path"); - snprintf (fake, sizeof(fake), "fake:%p", (gpointer)msg); + g_snprintf (fake, sizeof(fake), "fake:%p", (gpointer)msg); msgid = fake; } diff --git a/lib/utils/mu-str.c b/lib/utils/mu-str.c index 79e3e320..03931552 100644 --- a/lib/utils/mu-str.c +++ b/lib/utils/mu-str.c @@ -299,7 +299,7 @@ mu_str_fullpath_s (const char* path, const char* name) g_return_val_if_fail (path, NULL); - snprintf (buf, sizeof(buf), "%s%c%s", path, G_DIR_SEPARATOR, + g_snprintf (buf, sizeof(buf), "%s%c%s", path, G_DIR_SEPARATOR, name ? name : ""); return buf; diff --git a/lib/utils/mu-util.c b/lib/utils/mu-util.c index b896ea57..9f76c3af 100644 --- a/lib/utils/mu-util.c +++ b/lib/utils/mu-util.c @@ -135,7 +135,7 @@ mu_util_cache_dir (void) { static char cachedir [PATH_MAX]; - snprintf (cachedir, sizeof(cachedir), "%s%cmu-%u", + g_snprintf (cachedir, sizeof(cachedir), "%s%cmu-%u", g_get_tmp_dir(), G_DIR_SEPARATOR, getuid()); diff --git a/lib/utils/mu-utils.cc b/lib/utils/mu-utils.cc index e21b032d..9ebe801d 100644 --- a/lib/utils/mu-utils.cc +++ b/lib/utils/mu-utils.cc @@ -220,7 +220,7 @@ std::string Mu::date_to_time_t_string (int64_t t) { char buf[sizeof(InternalDateMax)]; - snprintf (buf, sizeof(buf), InternalDateFormat, t); + g_snprintf (buf, sizeof(buf), InternalDateFormat, t); return buf; } @@ -398,7 +398,7 @@ std::string Mu::size_to_string (int64_t size) { char buf[sizeof(SizeMax)]; - snprintf (buf, sizeof(buf), SizeFormat, size); + g_snprintf (buf, sizeof(buf), SizeFormat, size); return buf; } diff --git a/mu/mu-cmd-index.c b/mu/mu-cmd-index.c index 5f3c1125..6ddd55aa 100644 --- a/mu/mu-cmd-index.c +++ b/mu/mu-cmd-index.c @@ -137,7 +137,7 @@ print_stats (MuIndexStats* stats, gboolean clear, gboolean color) fputs ("\r", stdout); if (color) - snprintf + g_snprintf (output, sizeof(output), MU_COLOR_YELLOW "%c " MU_COLOR_DEFAULT "processing mail; " @@ -149,7 +149,7 @@ print_stats (MuIndexStats* stats, gboolean clear, gboolean color) (unsigned)stats->_updated, (unsigned)stats->_cleaned_up); else - snprintf + g_snprintf (output, sizeof(output), "%c processing mail; processed: %u; " "updated/new: %u, cleaned-up: %u",