From 24fa3798b20e0b02b820d72f826eb98a6bad32f5 Mon Sep 17 00:00:00 2001 From: Emil Mikulic Date: Wed, 13 Jan 2016 20:18:30 +1100 Subject: [PATCH] Explicitly cast getpid() result to int. This placates cppcheck. --- darkhttpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/darkhttpd.c b/darkhttpd.c index 3dde728..388739a 100644 --- a/darkhttpd.c +++ b/darkhttpd.c @@ -2581,7 +2581,7 @@ static void pidfile_create(void) { err(1, "ftruncate() failed"); } - snprintf(pidstr, sizeof(pidstr), "%u", getpid()); + snprintf(pidstr, sizeof(pidstr), "%d", (int)getpid()); if (pwrite(fd, pidstr, strlen(pidstr), 0) != (ssize_t)strlen(pidstr)) { error = errno; pidfile_remove();