[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-workers] Questionable patch from NetBSD pkgsrc

From: Eric Gillespie
Subject: [Nmh-workers] Questionable patch from NetBSD pkgsrc
Date: Fri, 08 Aug 2008 18:36:03 -0700

I found this patch in NetBSD's (quite ancient, until today) nmh


$NetBSD: patch-cd,v 1.5 2008/08/08 23:41:22 epg Exp $

--- sbr/fmt_scan.c.orig 2008-04-05 18:41:37.000000000 +0000
+++ sbr/fmt_scan.c      2008-08-08 21:24:12.000000000 +0000
@@ -300,8 +300,8 @@
     char *savestr;
     unsigned char *str = NULL;
     char buffer[BUFSIZ], buffer2[BUFSIZ];
-    int i, c, ljust, n;
-    int value = 0;
+    int i, ljust, n;
+    long long c, value = 0;
     time_t t;
     struct format *fmt;
     struct comp *comp;

The explanation is:

  Patch integer-to-decimal conversion problem which turns up with
        scan -format "%(clock{date})"
  This is a time_t > 1e9 problem.

I'm really not sure about it.  'c' looks like it ought to be char
anyway, being used with 'cp', 'sp', and so on.  As for 'value',
it is sometimes used to store the time_t returned by dmktime, so
at least the bug is real: int isn't necessarily as big as time_t.
I wonder if we must go so far as to use intmax_t and some
autoconf crap to find and typedef it, for older platforms.

Eric Gillespie <*> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]