From 9ccb22ca28a69990f6aa8a89dfb8c536531cbda9 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 2 Apr 2003 00:13:07 +0000 Subject: snprintf; drahn ok --- sbin/pdisk/pdisk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sbin/pdisk/pdisk.c') 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) { -- cgit v1.2.3