mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
Minor, coding style cleanup
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
fa0c63070c
commit
21db27ee75
1 file changed
+9
-5
+9
-5
@@ -665,13 +665,17 @@ static void parse_cmdline_args(svc_t *svc, char *cmd)
|
|||||||
|
|
||||||
strlcpy(svc->args[0], cmd, sizeof(svc->args[0]));
|
strlcpy(svc->args[0], cmd, sizeof(svc->args[0]));
|
||||||
|
|
||||||
/* Copy supplied args. Stop at MAX_NUM_SVC_ARGS-1 to allow the args
|
/*
|
||||||
* array to be zero-terminated. */
|
* Copy supplied args. Stop at MAX_NUM_SVC_ARGS-1 to allow the args
|
||||||
for (i=1; (arg = strtok(NULL, " ")) && i < (MAX_NUM_SVC_ARGS-1); i++)
|
* array to be zero-terminated.
|
||||||
|
*/
|
||||||
|
for (i = 1; (arg = strtok(NULL, " ")) && i < (MAX_NUM_SVC_ARGS - 1); i++)
|
||||||
strlcpy(svc->args[i], arg, sizeof(svc->args[0]));
|
strlcpy(svc->args[i], arg, sizeof(svc->args[0]));
|
||||||
|
|
||||||
/* clear remaining args in case they were set earlier.
|
/*
|
||||||
* This also zero-terminates the args array.*/
|
* Clear remaining args in case they were set earlier.
|
||||||
|
* This also zero-terminates the args array.
|
||||||
|
*/
|
||||||
for (; i < MAX_NUM_SVC_ARGS; i++)
|
for (; i < MAX_NUM_SVC_ARGS; i++)
|
||||||
svc->args[i][0] = 0;
|
svc->args[i][0] = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user