Skip to content

Commit 3a148d0

Browse files
committed
fix: migrate remaining %llu in snprintf/sscanf to PRIu64/SCNu64
1 parent bda5edd commit 3a148d0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

core/txdb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ txdb_serialize_tx_key(uint64 tx_seq,
331331

332332
buf = buff_alloc();
333333

334-
snprintf(str, sizeof str, "/tx/%010llu/%s", tx_seq, hashStr);
334+
snprintf(str, sizeof str, "/tx/%010" PRIu64 "/%s", tx_seq, hashStr);
335335
serialize_bytes(buf, str, strlen(str) + 1); /* include terminal '\0' */
336336

337337
log_info(LGPFX" adding %s seq=%" PRIu64 " : '%s'\n", hashStr, tx_seq, str);
@@ -361,7 +361,7 @@ txdb_deserialize_tx_key(const void *key,
361361

362362
tx = safe_calloc(1, sizeof *tx);
363363

364-
n = sscanf(key, "/tx/%010llu/%s", &tx->seq, hashStr);
364+
n = sscanf(key, "/tx/%010" SCNu64 "/%s", &tx->seq, hashStr);
365365
ASSERT(n == 2);
366366
s = uint256_from_str(hashStr, &tx->txHash);
367367
ASSERT(s);

lib/util/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ LogPrintf(bool warning,
301301
localtime_r(&tv.tv_sec, &tmp);
302302

303303
strftime(tsPfx0, sizeof tsPfx0, "%T", &tmp);
304-
snprintf(tsPfx, sizeof tsPfx, "%s.%06llu", tsPfx0, (uint64)(tv.tv_nsec / 1000));
304+
snprintf(tsPfx, sizeof tsPfx, "%s.%06" PRIu64, tsPfx0, (uint64)(tv.tv_nsec / 1000));
305305

306306
vsnprintf(msg, sizeof msg, format, args);
307307

0 commit comments

Comments
 (0)