Fix portability bugs uncovered by Alpine Linux/musl libc

This commit is contained in:
Lassi Kortela 2019-08-13 14:19:38 +03:00
parent 277abddaa8
commit 9b737144ea
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,8 @@
// Copyright 2019 Lassi Kortela
// SPDX-License-Identifier: BSD-3-Clause
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -39,7 +41,7 @@ void buf_putu(struct buf *buf, uint64_t u)
{
char tmp[24];
snprintf(tmp, sizeof(tmp), "%llu", u);
snprintf(tmp, sizeof(tmp), "%" PRIu64, u);
buf_puts(buf, tmp);
}

View File

@ -1,6 +1,6 @@
#include <sys/poll.h>
#include <sys/time.h>
#include <poll.h>
#include <stdint.h>
#include <string.h>
#include <time.h>