tweaks: rename a variable, to be a bit more fitting
parent
94347f0811
commit
45f8fc77e0
10
src/text.c
10
src/text.c
|
@ -2510,16 +2510,16 @@ void construct_argument_list(char ***arguments, char *command, char *filename)
|
||||||
{
|
{
|
||||||
char *copy_of_command = mallocstrcpy(NULL, command);
|
char *copy_of_command = mallocstrcpy(NULL, command);
|
||||||
char *element = strtok(copy_of_command, " ");
|
char *element = strtok(copy_of_command, " ");
|
||||||
size_t length = 2;
|
int count = 2;
|
||||||
|
|
||||||
while (element != NULL) {
|
while (element != NULL) {
|
||||||
*arguments = (char **)nrealloc(*arguments, ++length * sizeof(char *));
|
*arguments = (char **)nrealloc(*arguments, ++count * sizeof(char *));
|
||||||
(*arguments)[length - 3] = element;
|
(*arguments)[count - 3] = element;
|
||||||
element = strtok(NULL, " ");
|
element = strtok(NULL, " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
(*arguments)[length - 2] = filename;
|
(*arguments)[count - 2] = filename;
|
||||||
(*arguments)[length - 1] = NULL;
|
(*arguments)[count - 1] = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue