Don't print time_t with %lu; it fails on 32-bit netbsd, where time_t is

wider than that. PR 47991 from VSYakovetsky.
This commit is contained in:
dholland 2013-07-04 03:41:48 +00:00
parent 89000ca4bc
commit 659e689a21
3 changed files with 24 additions and 2 deletions

View file

@ -1,6 +1,7 @@
# $NetBSD: Makefile,v 1.82 2013/07/03 08:17:16 wiz Exp $
# $NetBSD: Makefile,v 1.83 2013/07/04 03:41:48 dholland Exp $
DISTNAME= mtr-0.85
PKGREVISION= 1
CATEGORIES= net
MASTER_SITES= ftp://ftp.bitwizard.nl/mtr/

View file

@ -1,5 +1,6 @@
$NetBSD: distinfo,v 1.37 2013/07/03 08:17:16 wiz Exp $
$NetBSD: distinfo,v 1.38 2013/07/04 03:41:48 dholland Exp $
SHA1 (mtr-0.85.tar.gz) = 77204a1a577cfca30c79c43a8fa3daafd280f1b8
RMD160 (mtr-0.85.tar.gz) = 0ca692799d3b4d4358d02f72787e8705c061c817
Size (mtr-0.85.tar.gz) = 534196 bytes
SHA1 (patch-report.c) = 13c834fa841bce84aadc57124b6de6ffbc8766e9

View file

@ -0,0 +1,20 @@
$NetBSD: patch-report.c,v 1.1 2013/07/04 03:41:48 dholland Exp $
Don't print time_t with %lu; it fails on 32-bit netbsd, where time_t is
wider than that.
--- report.c~ 2013-05-13 15:22:54.000000000 +0000
+++ report.c
@@ -343,10 +343,10 @@ void csv_close(time_t now)
if(!ipinfo_no) {
char* fmtinfo = fmt_ipinfo(addr);
if (fmtinfo != NULL) fmtinfo = trim(fmtinfo);
- printf("MTR.%s;%lu;%s;%s;%d;%s;%s;%d", MTR_VERSION, now, "OK", Hostname,
+ printf("MTR.%s;%lld;%s;%s;%d;%s;%s;%d", MTR_VERSION, (long long)now, "OK", Hostname,
at+1, name, fmtinfo, last);
} else {
- printf("MTR.%s;%lu;%s;%s;%d;%s;%d", MTR_VERSION, now, "OK", Hostname,
+ printf("MTR.%s;%lld;%s;%s;%d;%s;%d", MTR_VERSION, (long long)now, "OK", Hostname,
at+1, name, last);
}