From 877d5dfb62570f5865b95fe5c19182cfb2e2afa2 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 1 Apr 1999 21:10:14 +0000 Subject: Fix filesystem type when writing fstab in -f mode --- sbin/disklabel/editor.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'sbin') diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index ddf5250b16d..0e13db30440 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.58 1999/04/01 04:14:21 millert Exp $ */ +/* $OpenBSD: editor.c,v 1.59 1999/04/01 21:10:13 millert Exp $ */ /* * Copyright (c) 1997-1999 Todd C. Miller @@ -28,7 +28,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.58 1999/04/01 04:14:21 millert Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.59 1999/04/01 21:10:13 millert Exp $"; #endif /* not lint */ #include @@ -1995,7 +1995,7 @@ mpsave(lp, mp, cdev, fstabfile) char *cdev; char *fstabfile; { - int i, mpset; + int i, j, mpset; char bdev[MAXPATHLEN], *p; struct mountinfo mi[MAXPARTITIONS]; FILE *fp; @@ -2034,10 +2034,11 @@ mpsave(lp, mp, cdev, fstabfile) return(1); for (i = 0; i < MAXPARTITIONS && mi[i].mountpoint != NULL; i++) { - fprintf(fp, "%s%c %s %s rw 1 %d\n", bdev, 'a' + mi[i].partno, + j = mi[i].partno; + fprintf(fp, "%s%c %s %s rw 1 %d\n", bdev, 'a' + j, mi[i].mountpoint, - fstypesnames[lp->d_partitions[i].p_fstype], - i == 0 ? 1 : 2); + fstypesnames[lp->d_partitions[j].p_fstype], + j == 0 ? 1 : 2); } fclose(fp); printf("Wrote fstab entries to %s\n", fstabfile); -- cgit v1.2.3