Skip to content

Commit ba919cb

Browse files
committed
Move to PRIu64 macro for uint64_t
1 parent 70ff7b5 commit ba919cb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/server.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ static void on_data(ev_tcp_handle *client)
169169
{
170170
if (client->buffer.size == 0)
171171
return;
172-
Request rq;
173-
Response rs;
174-
ssize_t n = decode_request((const uint8_t *)client->buffer.buf, &rq);
172+
Request rq = {0};
173+
Response rs = {0};
174+
ssize_t n = decode_request((const uint8_t *)client->buffer.buf, &rq);
175175
if (n < 0) {
176176
log_error("Can't decode a request from data");
177177
rs.type = STRING_RSP;

src/wal.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "logging.h"
55
#include <errno.h>
66
#include <fcntl.h>
7+
#include <inttypes.h>
78
#include <stdio.h>
89
#include <string.h>
910
#include <sys/stat.h>
@@ -13,7 +14,7 @@ static const char t[2] = {'t', 'h'};
1314

1415
int wal_init(Wal *w, const char *path, uint64_t base_timestamp, int main)
1516
{
16-
snprintf(w->path, sizeof(w->path), "%s/wal-%c-%.20llu", path, t[main],
17+
snprintf(w->path, sizeof(w->path), "%s/wal-%c-%.20" PRIu64, path, t[main],
1718
base_timestamp);
1819
w->fp = open_file(w->path, "log", "w+");
1920
if (!w->fp)
@@ -45,7 +46,7 @@ int wal_delete(Wal *w)
4546
int wal_from_disk(Wal *w, const char *path, uint64_t base_timestamp, int main)
4647
{
4748
char path_buf[MAX_PATH_SIZE];
48-
snprintf(path_buf, sizeof(path_buf), "%s/wal-%c-%.20llu", path, t[main],
49+
snprintf(path_buf, sizeof(path_buf), "%s/wal-%c-%.20" PRIu64, path, t[main],
4950
base_timestamp);
5051
w->fp = open_file(path_buf, "log", "r");
5152
if (!w->fp)

0 commit comments

Comments
 (0)