summaryrefslogtreecommitdiff
path: root/sbin/pdisk/pdisk.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-02 00:13:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-02 00:13:07 +0000
commit9ccb22ca28a69990f6aa8a89dfb8c536531cbda9 (patch)
tree530268690c33b8624cf721ff80b502e4d91d936a /sbin/pdisk/pdisk.c
parentc58f787b3a0fc984307434d3bf6332b04bc894da (diff)
snprintf; drahn ok
Diffstat (limited to 'sbin/pdisk/pdisk.c')
-rw-r--r--sbin/pdisk/pdisk.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c
index d3fe0c88b05..ce373b30fc3 100644
--- a/sbin/pdisk/pdisk.c
+++ b/sbin/pdisk/pdisk.c
@@ -1037,8 +1037,7 @@ do_display_block(partition_map_header *map, char *alt_name)
return;
}
} else {
- name = malloc(strlen(alt_name)+1);
- strcpy(name, alt_name);
+ name = strdup(alt_name);
}
m = open_pathname_as_media(name, O_RDONLY);
if (m == 0) {