Fix -Wsign-compare error in keys.c
authorFufu Fang <fangfufu2003@gmail.com>
Mon, 9 Aug 2021 23:34:29 +0000 (00:34 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Tue, 10 Aug 2021 18:36:22 +0000 (20:36 +0200)
Part of https://github.com/gsliepen/tinc/issues/288

src/keys.c

index c857fb6..dacb87b 100644 (file)
@@ -21,7 +21,7 @@ bool disable_old_keys(const char *filename, const char *what) {
                return false;
        }
 
-       int result = snprintf(tmpfile, sizeof(tmpfile), "%s.tmp", filename);
+       size_t result = snprintf(tmpfile, sizeof(tmpfile), "%s.tmp", filename);
 
        if(result < sizeof(tmpfile)) {
                struct stat st = {.st_mode = 0600};