CVS commit: [netbsd-5] src/sbin/fdisk

2010-01-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jan  9 01:04:48 UTC 2010

Modified Files:
src/sbin/fdisk [netbsd-5]: fdisk.c

Log Message:
Pull up following revision(s) (requested by dsl in ticket #1207):
sbin/fdisk/fdisk.c: revision 1.128
Editing partitions larger than 1TB works better if 'decimal' returns
64 bit integer values!


To generate a diff of this commit:
cvs rdiff -u -r1.116.6.2 -r1.116.6.3 src/sbin/fdisk/fdisk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.116.6.2 src/sbin/fdisk/fdisk.c:1.116.6.3
--- src/sbin/fdisk/fdisk.c:1.116.6.2	Thu Dec 24 04:54:47 2009
+++ src/sbin/fdisk/fdisk.c	Sat Jan  9 01:04:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.116.6.2 2009/12/24 04:54:47 snj Exp $ */
+/*	$NetBSD: fdisk.c,v 1.116.6.3 2010/01/09 01:04:48 snj Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: fdisk.c,v 1.116.6.2 2009/12/24 04:54:47 snj Exp $);
+__RCSID($NetBSD: fdisk.c,v 1.116.6.3 2010/01/09 01:04:48 snj Exp $);
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -246,7 +246,7 @@
 int	read_s0(daddr_t, struct mbr_sector *);
 int	write_mbr(void);
 int	yesno(const char *, ...);
-int	decimal(const char *, int64_t, int, int64_t, int64_t);
+int64_t	decimal(const char *, int64_t, int, int64_t, int64_t);
 #define DEC_SEC		1		/* asking for a sector number */
 #define	DEC_RND		2		/* round to end of first track */
 #define	DEC_RND_0	4		/* round 0 to size of a track */
@@ -2618,7 +2618,7 @@
 	return (first == 'y' || first == 'Y');
 }
 
-int
+int64_t
 decimal(const char *prompt, int64_t dflt, int flags, int64_t minval, int64_t maxval)
 {
 	int64_t acc = 0;



CVS commit: [netbsd-5] src/sbin/fdisk

2009-04-20 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Apr 20 23:16:45 UTC 2009

Modified Files:
src/sbin/fdisk [netbsd-5]: fdisk.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #712):
sbin/fdisk/fdisk.c: revision 1.119
When using -s flag, read start and size as unsigned to allow for larger
disks. (Thanks to drochner@ for catching it).


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.116.6.1 src/sbin/fdisk/fdisk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.116 src/sbin/fdisk/fdisk.c:1.116.6.1
--- src/sbin/fdisk/fdisk.c:1.116	Sun Mar  9 14:57:10 2008
+++ src/sbin/fdisk/fdisk.c	Mon Apr 20 23:16:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.116 2008/03/09 14:57:10 tnn Exp $ */
+/*	$NetBSD: fdisk.c,v 1.116.6.1 2009/04/20 23:16:45 snj Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: fdisk.c,v 1.116 2008/03/09 14:57:10 tnn Exp $);
+__RCSID($NetBSD: fdisk.c,v 1.116.6.1 2009/04/20 23:16:45 snj Exp $);
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -296,8 +296,8 @@
 	char *cbootmenu = 0;
 #endif
 
-	int csysid, cstart, csize;	/* For the b_flag. */
-
+	int csysid;	/* For the b_flag. */
+	unsigned int cstart, csize;
 	a_flag = i_flag = u_flag = sh_flag = f_flag = s_flag = b_flag = 0;
 	v_flag = 0;
 	E_flag = 0;
@@ -355,7 +355,7 @@
 			break;
 		case 's':	/* Partition details */
 			s_flag = 1;
-			if (sscanf(optarg, %d/%d/%d%n, csysid, cstart,
+			if (sscanf(optarg, %d/%u/%u%n, csysid, cstart,
 			csize, n) == 3) {
 if (optarg[n] == 0)
 	break;