Fix Werrors with GCC-14.1.0
[platform/upstream/rpm.git] / rpmkeys.c
index fa4e4d8..2b60a72 100644 (file)
--- a/rpmkeys.c
+++ b/rpmkeys.c
@@ -5,10 +5,6 @@
 #include "cliutils.h"
 #include "debug.h"
 
-#if !defined(__GLIBC__) && !defined(__APPLE__)
-char ** environ = NULL;
-#endif
-
 enum modes {
     MODE_CHECKSIG      = (1 << 0),
     MODE_IMPORTKEY     = (1 << 1),
@@ -49,10 +45,14 @@ static struct poptOption optionsTable[] = {
 int main(int argc, char *argv[])
 {
     int ec = EXIT_FAILURE;
-    poptContext optCon = rpmcliInit(argc, argv, optionsTable);
+    poptContext optCon = NULL;
     rpmts ts = rpmtsCreate();
     ARGV_const_t args = NULL;
+
+    xsetprogname(argv[0]); /* Portability call -- see system.h */
     
+    optCon = rpmcliInit(argc, argv, optionsTable);
+
     if (argc < 2) {
        printUsage(optCon, stderr, 0);
        goto exit;