]> diplodocus.org Git - nmh/commitdiff
mhparse.c: Cast ptrdiff_t from subtraction to long.
authorRalph Corderoy <ralph@inputplus.co.uk>
Fri, 11 Aug 2017 14:34:41 +0000 (15:34 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Fri, 11 Aug 2017 14:34:41 +0000 (15:34 +0100)
Cygwin's 32-bit doesn't like `%ld' for the `p - q' difference between
two pointers as the value is an int, not a long.  printf(3)'s `t' length
modifier, for ptrdiff_t, can't be used as that's C99, and we're C90.
Cast the difference to a long explicitly instead.

uip/mhparse.c

index cfcbf65..76dd7f7 100644 (file)
@@ -3306,7 +3306,7 @@ parse_header_attrs (const char *filename, const char *fieldname,
        if (dp == cp || *dp != '=') {
             inform("invalid parameter in message %s's %s: field\n"
                 "    parameter %s (error detected at offset %ld)",
-                filename, fieldname, cp, dp - cp);
+                filename, fieldname, cp, (long)(dp - cp));
            return NOTOK;
        }