Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2005/0909/3

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Zero allocated data structures.
 [rsc] --rw-rw-r-- M 383570 glenda sys 6665 Sep  9 11:04 sys/src/libdisk/disk.c
	/n/sourcesdump/2005/0909/plan9/sys/src/libdisk/disk.c:272,278 - 
	/n/sourcesdump/2005/0910/plan9/sys/src/libdisk/disk.c:272,278
	  	char *p, *q;
	  	Disk *d;
	  
	- 	d = malloc(sizeof(*d));
	+ 	d = mallocz(sizeof(*d), 1);
	  	if(d == nil)
	  		return nil;
	  
	/n/sourcesdump/2005/0909/plan9/sys/src/libdisk/disk.c:347,350 - 
	/n/sourcesdump/2005/0910/plan9/sys/src/libdisk/disk.c:347,349
	  	d->type = Tfile;
	  	return openfile(d);
	  }
	- 
 [rsc] --rw-rw-r-- M 383570 glenda sys 6023 Sep  9 11:04 sys/src/libdisk/scsi.c
	/n/sourcesdump/2005/0909/plan9/sys/src/libdisk/scsi.c:308,320 - 
	/n/sourcesdump/2005/0910/plan9/sys/src/libdisk/scsi.c:308,319
	  	if((p = strdup(buf+8)) == nil)
	  		goto Error;
	  
	- 	s = malloc(sizeof(*s));
	+ 	s = mallocz(sizeof(*s), 1);
	  	if(s == nil) {
	  	Error1:
	  		free(p);
	  		goto Error;
	  	}
	- 	memset(s, 0, sizeof(*s));
	  
	  	s->rawfd = rawfd;
	  	s->inquire = p;
 [sys] --rwxrwxr-x M 383570 glenda sys 161177 Sep  9 23:08 386/bin/cdfs
	/sys/src/libdisk/scsi.c:openscsi
 [sys] --rwxrwxr-x M 383570 glenda sys 103794 Sep  9 23:08 386/bin/disk/fdisk
 [sys] --rwxrwxr-x M 383570 glenda sys 89534 Sep  9 23:08 386/bin/disk/format
 [sys] --rwxrwxr-x M 383570 glenda sys 73689 Sep  9 23:08 386/bin/disk/mbr
	/sys/src/libdisk/disk.c:opendisk
 [sys] --rw-rw-r-- M 383570 glenda sys 42236 Sep  9 23:08 386/lib/libdisk.a


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.