chiark / gitweb /
Fix integer type mismatch on 64-bit systems
authorSteven Grimm <koreth@midwinter.com>
Sun, 3 Jun 2007 21:12:06 +0000 (14:12 -0700)
committerJonas Fonseca <fonseca@diku.dk>
Mon, 4 Jun 2007 06:39:48 +0000 (08:39 +0200)
fprintf wants an int parameter for the field width of a "%.*s" expression, but
the code was passing a size_t instead. This potentially broke systems where
sizeof(size_t) != sizeof(int). And even on systems where it did't break,
it still caused a compiler warning.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
tig.c

diff --git a/tig.c b/tig.c
index 6adfb334e9d3546511ffc737a2e89621f50631fc..b09d91bf98189b3ea947eaba3b254bfea3dbc10c 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -1153,7 +1153,7 @@ read_option(char *opt, size_t optlen, char *value, size_t valuelen)
 
        if (status == ERR) {
                fprintf(stderr, "Error on line %d, near '%.*s': %s\n",
-                       config_lineno, optlen, opt, config_msg);
+                       config_lineno, (int) optlen, opt, config_msg);
                config_errors = TRUE;
        }