This function will be used to convert char *arr[] arrays
(like argv[] and envp[]) arrays to simple strings.
Change-Id: I352f2cc35ee5f06f6a9e6bc81b45702ea11f711d
return result;
}
+
+char *nullvec2str(char *const vec[])
+{
+ char command[PATH_MAX] = {0, };
+
+ for (char *const *p = vec; *p; ++p) {
+ strncat(command, *p, sizeof(command)-1);
+ strncat(command, " ", sizeof(command)-1);
+ }
+ command[sizeof(command)-1] = 0;
+ return strdup(command);
+}
/**
* @}
*/
char* get_exe_path(pid_t pid);
char* get_cmd_line(pid_t pid);
+
+char *nullvec2str(char *const vec[]);
/**
* @}
*/