From bb66209012bcc33dd2df316a1c42afe1a869fdc1 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 29 Apr 2009 14:24:45 +0200 Subject: [PATCH] fdisk: fix max. ptname Signed-off-by: Karel Zak --- fdisk/fdisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c index e3b6857f..ef75d4ce 100644 --- a/fdisk/fdisk.c +++ b/fdisk/fdisk.c @@ -2554,7 +2554,7 @@ try(char *device, int user_specified) { static void tryprocpt(void) { FILE *procpt; - char line[100], ptname[100], devname[120]; + char line[128], ptname[128], devname[256]; int ma, mi; unsigned long long sz; @@ -2565,7 +2565,7 @@ tryprocpt(void) { } while (fgets(line, sizeof(line), procpt)) { - if (sscanf (line, " %d %d %llu %100[^\n ]", + if (sscanf (line, " %d %d %llu %128[^\n ]", &ma, &mi, &sz, ptname) != 4) continue; snprintf(devname, sizeof(devname), "/dev/%s", ptname); -- 2.39.5