]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
build: typecast NGREG to int
authorNatanael Copa <ncopa@alpinelinux.org>
Tue, 4 Mar 2014 15:22:45 +0000 (15:22 +0000)
committerNatanael Copa <ncopa@alpinelinux.org>
Tue, 4 Mar 2014 15:22:45 +0000 (15:22 +0000)
Fixes the following error with musl libc:

src/trap.c: In function 'traphandler':
src/trap.c:178:3: error: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Werror=format=]
   snprintf(tmpbuf, sizeof(tmpbuf), "Register dump [%d]: ", NGREG);
      ^

src/trap.c

index 00664724fc010c1bd1ddec6823ebce88d7f48547..b0f1c358f3538420ea0cafe85e9352d36b9f1797 100644 (file)
@@ -175,7 +175,7 @@ traphandler(int sig, siginfo_t *si, void *UC)
 
   tvhlog_spawn(LOG_ALERT, "CRASH", "Loaded libraries: %s ", libs);
 #ifdef NGREG
-  snprintf(tmpbuf, sizeof(tmpbuf), "Register dump [%d]: ", NGREG);
+  snprintf(tmpbuf, sizeof(tmpbuf), "Register dump [%d]: ", (int)NGREG);
 
   for(i = 0; i < NGREG; i++) {
     sappend(tmpbuf, sizeof(tmpbuf), "%016" PRIx64, uc->uc_mcontext.gregs[i]);