mirror of
https://github.com/ericonr/util-linux.git
synced 2024-04-21 09:12:35 -05:00
fdisk: fix max. ptname
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
18c3e24341
commit
bb66209012
@ -2554,7 +2554,7 @@ try(char *device, int user_specified) {
|
|||||||
static void
|
static void
|
||||||
tryprocpt(void) {
|
tryprocpt(void) {
|
||||||
FILE *procpt;
|
FILE *procpt;
|
||||||
char line[100], ptname[100], devname[120];
|
char line[128], ptname[128], devname[256];
|
||||||
int ma, mi;
|
int ma, mi;
|
||||||
unsigned long long sz;
|
unsigned long long sz;
|
||||||
|
|
||||||
@ -2565,7 +2565,7 @@ tryprocpt(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (fgets(line, sizeof(line), procpt)) {
|
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)
|
&ma, &mi, &sz, ptname) != 4)
|
||||||
continue;
|
continue;
|
||||||
snprintf(devname, sizeof(devname), "/dev/%s", ptname);
|
snprintf(devname, sizeof(devname), "/dev/%s", ptname);
|
||||||
|
Loading…
Reference in New Issue
Block a user