aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/fdformat/fdformat.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/fdformat/fdformat.c')
-rw-r--r--usr.sbin/fdformat/fdformat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/fdformat/fdformat.c b/usr.sbin/fdformat/fdformat.c
index 0e624dec2705..dd92a86a5077 100644
--- a/usr.sbin/fdformat/fdformat.c
+++ b/usr.sbin/fdformat/fdformat.c
@@ -205,7 +205,7 @@ main(int argc, char **argv)
if (stat(argv[optind], &sb) == -1 && errno == ENOENT) {
/* try prepending _PATH_DEV */
- device = malloc(strlen(argv[optind] + sizeof _PATH_DEV + 1));
+ device = malloc(strlen(argv[optind]) + sizeof(_PATH_DEV) + 1);
if (device == 0)
errx(EX_UNAVAILABLE, "out of memory");
strcpy(device, _PATH_DEV);