Files
pkgsrc-ng/devel/diffutils/patches/patch-ab
2016-11-18 22:39:22 +01:00

21 lines
802 B
Plaintext

$NetBSD: patch-ab,v 1.3 2016/08/09 13:35:28 mef Exp $
date: 2009-03-10 23:06:06 +0900; author: apb; state: Exp;
Fix a build failure on platforms where time_t is larger than long, by
using long long instead. (Not using time_t, because there's no easy and
portable printf format for time_t.)
--- src/context.c.orig 2012-04-07 01:25:21.000000000 +0200
+++ src/context.c 2012-04-07 01:27:52.000000000 +0200
@@ -56,8 +56,8 @@
if (LONG_MIN <= TYPE_MINIMUM (time_t)
&& TYPE_MAXIMUM (time_t) <= LONG_MAX)
{
- long int sec = inf->stat.st_mtime;
- sprintf (buf, "%ld.%.9d", sec, nsec);
+ long long int sec = inf->stat.st_mtime; /* should really be time_t */
+ sprintf (buf, "%lld.%.9d", sec, nsec);
}
else if (TYPE_MAXIMUM (time_t) <= INTMAX_MAX)
{