diff options
| author | Toomas Soome <tsoome@me.com> | 2018-08-16 14:21:13 +0300 |
|---|---|---|
| committer | Robert Mustacchi <rm@joyent.com> | 2018-08-20 22:52:45 +0000 |
| commit | e8fda3522f688f9e55aa251eafc9b42b78717d40 (patch) | |
| tree | 6b34d0d5c1d780bb322eec7e1d728cdb29457163 | |
| parent | 81a867407659fae007ac4ca95e5685c1d38fa5f1 (diff) | |
| download | illumos-joyent-e8fda3522f688f9e55aa251eafc9b42b78717d40.tar.gz | |
9740 libi386: use snprintf in biosdisk and style fixes
Reviewed by: Jason King <jason.king@joyent.com>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Approved by: Robert Mustacchi <rm@joyent.com>
| -rw-r--r-- | usr/src/boot/sys/boot/i386/libi386/biosdisk.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/usr/src/boot/sys/boot/i386/libi386/biosdisk.c b/usr/src/boot/sys/boot/i386/libi386/biosdisk.c index adc58dda25..b60f989d00 100644 --- a/usr/src/boot/sys/boot/i386/libi386/biosdisk.c +++ b/usr/src/boot/sys/boot/i386/libi386/biosdisk.c @@ -301,9 +301,8 @@ bd_print(int verbose) ('C' + bdinfo[i].bd_unit - 0x80), (uintmax_t)bdinfo[i].bd_sectors, bdinfo[i].bd_sectorsize); - ret = pager_output(line); - if (ret != 0) - return (ret); + if ((ret = pager_output(line)) != 0) + break; dev.dd.d_dev = &biosdisk; dev.dd.d_unit = i; @@ -312,11 +311,11 @@ bd_print(int verbose) if (disk_open(&dev, bdinfo[i].bd_sectorsize * bdinfo[i].bd_sectors, bdinfo[i].bd_sectorsize) == 0) { - sprintf(line, " disk%d", i); + snprintf(line, sizeof (line), " disk%d", i); ret = disk_print(&dev, line, verbose); disk_close(&dev); if (ret != 0) - return (ret); + break; } } return (ret); @@ -437,7 +436,6 @@ bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, bcd.dv_strategy = bd_realstrategy; bcd.dv_devdata = devdata; bcd.dv_cache = BD(dev).bd_bcache; - return (bcache_strategy(&bcd, rw, dblk + dev->d_offset, size, buf, rsize)); } |
