]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/misc-progs/pakfire.c
Merge remote-tracking branch 'origin/next' into fifteen
[people/pmueller/ipfire-2.x.git] / src / misc-progs / pakfire.c
index 04e8f01b112d1a6f5443594d87f6521c40197b73..fe6edfc32948c496df9f05ffa057bdcb427978ae 100644 (file)
 
 int main(int argc, char *argv[]) {
        int i;
-       char command; // Add size here
-       char add; // Add size here
-       
+       char command[STRING_SIZE] = "/opt/pakfire/pakfire";
+       char temp[STRING_SIZE];
+
        if (!(initsetuid()))
                exit(1);
 
-       sprintf(command, "/opt/pakfire/pakfire");
-
-       for (i = 0; i < argc - 1; i++) {
-               sprintf(add, " %s", argv[i]);
-               strcat(command, add);
+       for (i = 1; i < argc; i++) {
+               snprintf(temp, STRING_SIZE, "%s %s", command, argv[i]);
+               snprintf(command, STRING_SIZE, "%s", temp);
        }
-       
+
        return safe_system(command);
-       
 }