summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-04-01 21:10:14 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-04-01 21:10:14 +0000
commit877d5dfb62570f5865b95fe5c19182cfb2e2afa2 (patch)
tree0a0715de6bf8e1eefce07bb9cad6809e3d937e33 /sbin
parent5b604ccd926d5b99452e789cebbb1872eca83d42 (diff)
Fix filesystem type when writing fstab in -f mode
Diffstat (limited to 'sbin')
-rw-r--r--sbin/disklabel/editor.c13
1 files changed, 7 insertions, 6 deletions
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 <Todd.Miller@courtesan.com>
@@ -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 <sys/types.h>
@@ -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);