use g_snprintf instead of snprintf

Seems the latter cannot be found on some platforms; perhaps a
c++/namespace thing?

Use g_snprintf instead.
This commit is contained in:
Dirk-Jan C. Binnema
2020-01-07 23:15:22 +02:00
parent 38a91f3696
commit b2014fe93e
7 changed files with 12 additions and 12 deletions

View File

@ -306,7 +306,7 @@ Store::set_path_tstamp (const std::string& path, time_t tstamp)
LOCKED;
std::array<char, 2*sizeof(tstamp)+1> 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);
}