Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153361581
D22729.id65384.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D22729.id65384.diff
View Options
Index: sbin/newfs_msdos/mkfs_msdos.c
===================================================================
--- sbin/newfs_msdos/mkfs_msdos.c
+++ sbin/newfs_msdos/mkfs_msdos.c
@@ -318,7 +318,8 @@
bpb.bpbHiddenSecs = o.hidden_sectors;
if (!(o.floppy || (o.drive_heads && o.sectors_per_track &&
o.bytes_per_sector && o.size && o.hidden_sectors_set))) {
- getdiskinfo(fd, fname, dtype, o.hidden_sectors_set, &bpb);
+ if (getdiskinfo(fd, fname, dtype, o.hidden_sectors_set, &bpb) == -1)
+ goto done;
bpb.bpbHugeSectors -= (o.offset / bpb.bpbBytesPerSec);
if (bpb.bpbSecPerClust == 0) { /* set defaults */
if (bpb.bpbHugeSectors <= 6000) /* about 3MB -> 512 bytes */
@@ -423,10 +424,7 @@
bname = o.bootstrap;
if (!strchr(bname, '/')) {
snprintf(buf, sizeof(buf), "/boot/%s", bname);
- if (!(bname = strdup(buf))) {
- warn(NULL);
- goto done;
- }
+ bname = buf;
}
if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb)) {
warn("%s", bname);
Index: sbin/newfs_msdos/newfs_msdos.c
===================================================================
--- sbin/newfs_msdos/newfs_msdos.c
+++ sbin/newfs_msdos/newfs_msdos.c
@@ -185,8 +185,7 @@
fname = *argv++;
if (!o.create_size && !strchr(fname, '/')) {
snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname);
- if (!(fname = strdup(buf)))
- err(1, NULL);
+ fname = buf;
}
dtype = *argv;
exit(!!mkfs_msdos(fname, dtype, &o));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 5:25 PM (1 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31923050
Default Alt Text
D22729.id65384.diff (1 KB)
Attached To
Mode
D22729: Fix a couple of minor issues with newfs_msdos
Attached
Detach File
Event Timeline
Log In to Comment