char ***out_fcmd;
char **out_err;
{
- char * out_path;
char * err;
char ** tmp_fcmd;
char * path_ptr, *path;
return FALSE;
}
- out_path = (char *) xmalloc(strlen(tc) + strlen(fcmd) + 2);
- sprintf(out_path,"%s/%s",tc, fcmd );
-
- tmp_fcmd[i] = out_path;
+ tmp_fcmd[i] = xasprintf("%s/%s", tc, fcmd);
i++;
*/
#include "ksu.h"
+#include <stdarg.h>
+#include "k5-platform.h"
void *xmalloc (size_t sz)
{
memcpy (dst, src, len);
return dst;
}
+
+char *xasprintf (const char *format, ...)
+{
+ char *out;
+ va_list args;
+
+ va_start (args, format);
+ if (vasprintf(&out, format, args) < 0) {
+ perror (prog_name);
+ exit (1);
+ }
+ va_end(args);
+ return out;
+}