[OpenWrt-Devel] [PATCH] ucert: Cast ucert_argv to proper type when passing to execv

Rosen Penev rosenp at gmail.com
Thu Nov 28 14:17:20 EST 2019


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 at gmail.com>
---
 usign-exec.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/usign-exec.c b/usign-exec.c
index 949e83e..85e5f95 100644
--- a/usign-exec.c
+++ b/usign-exec.c
@@ -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;
-- 
2.23.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list