]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/misc-progs/pakfire.c
suricata: Fix amount of listened nfqueues
[ipfire-2.x.git] / src / misc-progs / pakfire.c
index 113216faa71dede918f35c49f740d25d74d9e0aa..fe6edfc32948c496df9f05ffa057bdcb427978ae 100644 (file)
 
 int main(int argc, char *argv[]) {
        int i;
-       char command[1024];
-       char add[STRING_SIZE];
-       
+       char command[STRING_SIZE] = "/opt/pakfire/pakfire";
+       char temp[STRING_SIZE];
+
        if (!(initsetuid()))
                exit(1);
 
-       snprintf(command, STRING_SIZE, "/opt/pakfire/pakfire");
-
        for (i = 1; i < argc; i++) {
-               sprintf(add, " %s", argv[i]);
-               strcat(command, add);
+               snprintf(temp, STRING_SIZE, "%s %s", command, argv[i]);
+               snprintf(command, STRING_SIZE, "%s", temp);
        }
-       
+
        return safe_system(command);
 }