71,7 → 71,7 |
char *path_tok; |
char *path[PATH_MAX]; |
int n = 0, i = 0; |
size_t x = strlen(cmd) + 2; |
size_t x = str_size(cmd) + 2; |
|
found = (char *)malloc(PATH_MAX); |
|
80,12 → 80,12 |
return (char *) cmd; |
} |
|
path_tok = strdup(PATH); |
path_tok = str_dup(PATH); |
|
/* Extract the PATH env to a path[] array */ |
path[n] = strtok(path_tok, PATH_DELIM); |
while (NULL != path[n]) { |
if ((strlen(path[n]) + x ) > PATH_MAX) { |
if ((str_size(path[n]) + x ) > PATH_MAX) { |
cli_error(CL_ENOTSUP, |
"Segment %d of path is too large, search ends at segment %d", |
n, n-1); |
114,7 → 114,7 |
task_id_t tid; |
char *tmp; |
|
tmp = strdup(find_command(cmd)); |
tmp = str_dup(find_command(cmd)); |
free(found); |
|
tid = task_spawn((const char *)tmp, argv); |