cast ucert_argv to proper type when passing to execv
authorRosen Penev <rosenp@gmail.com>
Thu, 28 Nov 2019 19:17:20 +0000 (11:17 -0800)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 28 Nov 2019 20:20:13 +0000 (21:20 +0100)
Fixes warnings:

warning: passing argument 2 of 'execv' from incompatible pointer type
[-Wincompatible-pointer-types]
  254 |       execv(usign_argv[0], usign_argv)

Signed-off-by: Rosen Penev <rosenp@gmail.com>
usign-exec.c

index 949e83e..85e5f95 100644 (file)
@@ -74,9 +74,9 @@ int usign_s(const char *msgfile, const char *seckeyfile, const char *sigfile, bo
        case 0:
                if (
 #ifdef UCERT_HOST_BUILD
-                       execvp(usign_argv[0], usign_argv)
+                       execvp(usign_argv[0], (char *const *)usign_argv)
 #else
-                       execv(usign_argv[0], usign_argv)
+                       execv(usign_argv[0], (char *const *)usign_argv)
 #endif
                   )
                        return -1;
@@ -143,9 +143,9 @@ static int usign_f(char *fingerprint, const char *pubkeyfile, const char *seckey
 
                if (
 #ifdef UCERT_HOST_BUILD
-                   execvp(usign_argv[0], usign_argv)
+                   execvp(usign_argv[0], (char *const *)usign_argv)
 #else
-                   execv(usign_argv[0], usign_argv)
+                   execv(usign_argv[0], (char *const *)usign_argv)
 #endif
                   )
                        return -1;
@@ -249,9 +249,9 @@ int usign_v(const char *msgfile, const char *pubkeyfile,
        case 0:
                if (
 #ifdef UCERT_HOST_BUILD
-                   execvp(usign_argv[0], usign_argv)
+                   execvp(usign_argv[0], (char *const *)usign_argv)
 #else
-                   execv(usign_argv[0], usign_argv)
+                   execv(usign_argv[0], (char *const *)usign_argv)
 #endif
                   )
                        return -1;