Fixed execute logging
This commit is contained in:
parent
68ab3f4eef
commit
20864b64b4
@ -35,7 +35,6 @@
|
||||
int e_pid = 0; /* Execute child pid */
|
||||
|
||||
|
||||
|
||||
int _execute(char **, char *, char *, char *);
|
||||
int _execute(char **args, char *in, char *out, char *err)
|
||||
{
|
||||
@ -45,7 +44,7 @@ int _execute(char **args, char *in, char *out, char *err)
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (args[i])
|
||||
snprintf(buf, PATH_MAX -1, "%s %s", buf, args[i]);
|
||||
snprintf(buf + strlen(buf), PATH_MAX - strlen(buf), " %s", args[i]);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
@ -164,9 +164,10 @@ int execute(char **args, char *in, char *out, char *err)
|
||||
char buf[PATH_MAX];
|
||||
int i, pid, status = 0, rc = 0;
|
||||
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (args[i])
|
||||
snprintf(buf, PATH_MAX, "%s %s", buf, args[i]);
|
||||
snprintf(buf + strlen(buf), PATH_MAX - strlen(buf), " %s", args[i]);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ int execute(char **args, char *in, char *out, char *err)
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (args[i])
|
||||
snprintf(buf, PATH_MAX, "%s %s", buf, args[i]);
|
||||
snprintf(buf + strlen(buf), PATH_MAX - strlen(buf), " %s", args[i]);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user