tools: fixes for 64-bit.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 20 Oct 2010 02:07:45 +0000 (12:37 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 20 Oct 2010 02:07:45 +0000 (12:37 +1030)
printf's %.* means an unsigned arg, not a size_t.

tools/ccanlint/tests/examples_compile.c
tools/tools.c

index b1798c937f36a4fb14205816183c91a1566b7d97..4f2d2c8a99189b058e7610b101cbcd264dca186c 100644 (file)
@@ -156,7 +156,7 @@ static char *add_func(char *others, const char *line)
        }
 
        return talloc_asprintf_append(others, "printf(\"%%p\", %.*s);\n",
-                                     end - p + 1, p);
+                                     (unsigned)(end - p + 1), p);
 }
 
 static void strip_leading_whitespace(char **lines)
index 16246593b8b7561534df56f7eb7cd533f884c8b0..b93448278648034f8835668db5476cc6abe038c5 100644 (file)
@@ -213,7 +213,7 @@ char *temp_dir(const void *ctx)
 char *maybe_temp_file(const void *ctx, const char *extension, bool keep,
                      const char *srcname)
 {
-       size_t baselen;
+       unsigned baselen;
        char *f, *suffix = talloc_strdup(ctx, "");
        struct stat st;
        unsigned int count = 0;