Subject: src/sbin/dkctl/dkctl.c typo
To: None <rumble@netbsd.org>
From: Jukka Salmi <j+nbsd@2006.salmi.ch>
List: current-users
Date: 03/17/2006 18:54:30
--zhXaljGHf11kAtnf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,

you forgot a closing quote (see attached patch) which makes the build
currently fail with

#   compile  dkctl/dkctl.o
/opt/tools/i386/bin/i386--netbsdelf-gcc -O2  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings  -Werror    -nostdinc -isystem /opt/dst/i386/usr/include  -c    /usr/src/sbin/dkctl/dkctl.c
/usr/src/sbin/dkctl/dkctl.c: In function `disk_badsectors':
/usr/src/sbin/dkctl/dkctl.c:425: warning: assignment makes pointer from integer without a cast
/usr/src/sbin/dkctl/dkctl.c:426: error: parse error before "err"
[...]
Stop.
nbmake: stopped in /usr/src/sbin/dkctl


Cheers, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

--zhXaljGHf11kAtnf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: sbin/dkctl/dkctl.c
===================================================================
RCS file: /cvsroot/src/sbin/dkctl/dkctl.c,v
retrieving revision 1.13
diff -u -p -r1.13 dkctl.c
--- sbin/dkctl/dkctl.c	17 Mar 2006 15:53:46 -0000	1.13
+++ sbin/dkctl/dkctl.c	17 Mar 2006 17:48:35 -0000
@@ -422,7 +422,7 @@ disk_badsectors(int argc, char *argv[])
 
 			dbs = (struct disk_badsectors *)dbsi.dbsi_buffer;
 			for (count = dbsi.dbsi_copied; count > 0; count--) {
-				if ((dbs2 = malloc(sizeof(*dbs2)) == NULL)
+				if ((dbs2 = malloc(sizeof(*dbs2))) == NULL)
 					err(1, NULL);
 				*dbs2 = *dbs;
 				SLIST_INSERT_HEAD(&dbstop, dbs2, dbs_next);

--zhXaljGHf11kAtnf--