Skip to content

Commit

Permalink
fix: use propert uint64_t formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed Apr 13, 2024
1 parent 29d1c33 commit 7b817da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/impl/int.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>

#define LIBWHEEL_TYPE uint64_t
#define LIBWHEEL_ALIAS int
Expand Down Expand Up @@ -31,13 +32,13 @@ uint64_t int_trait_hash(const uint64_t t) {

#define LIBWHEEL_TRAIT_STRINGIFY
uint64_t int_trait_stringify(char* target, const uint64_t t) {
const int size = snprintf(NULL, 0, "%llu", t);
const int size = snprintf(NULL, 0, "%" PRIu64, t);

if (target == NULL) {
return size;
}

return snprintf(target, size + 1, "%llu", t);
return snprintf(target, size + 1, "%" PRIu64, t);
}

#define LIBWHEEL_TRAIT_SERIALIZE_JSON
Expand Down

0 comments on commit 7b817da

Please sign in to comment.