summaryrefslogtreecommitdiffstats
path: root/src/guestfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/guestfs.c')
-rw-r--r--src/guestfs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index ef0ca167..46326e48 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -808,9 +808,7 @@ guestfs__get_attach_method (guestfs_h *g)
break;
case ATTACH_METHOD_UNIX:
- ret = safe_malloc (g, strlen (g->attach_method_arg) + 5 + 1);
- strcpy (ret, "unix:");
- strcat (ret, g->attach_method_arg);
+ ret = safe_asprintf (g, "unix:%s", g->attach_method_arg);
break;
default: /* keep GCC happy - this is not reached */