diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-03-27 18:40:55 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-03-27 18:40:55 +0000 |
commit | 29b54561850f808bbf75d08979c2b0a109d8b723 (patch) | |
tree | 1de2bd6e2ca38129cd416b3293ba039c503d53b8 | |
parent | 301c19003408d33b80558cead138410625512c26 (diff) |
Fix strncpy usage and call a cdrom a cdrom in the fake label
-rw-r--r-- | sys/scsi/cd.c | 6 | ||||
-rw-r--r-- | sys/scsi/sd.c | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 228c0470bf0..10d5f7d77bc 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.29 1997/12/05 00:09:50 provos Exp $ */ +/* $OpenBSD: cd.c,v 1.30 1998/03/27 18:40:54 millert Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -1062,9 +1062,9 @@ cdgetdisklabel(dev, cd) /* as long as it's not 0 - readdisklabel divides by it (?) */ } - strncpy(lp->d_typename, "SCSI disk", 16); + strncpy(lp->d_typename, "SCSI CD-ROM", sizeof(lp->d_typename) - 1); lp->d_type = DTYPE_SCSI; - strncpy(lp->d_packname, "fictitious", 16); + strncpy(lp->d_packname, "fictitious", sizeof(lp->d_packname) - 1); lp->d_secperunit = cd->params.disksize; lp->d_rpm = 300; lp->d_interleave = 1; diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 821aff68dc5..94dc5733f81 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.26 1997/10/18 10:37:19 deraadt Exp $ */ +/* $OpenBSD: sd.c,v 1.27 1998/03/27 18:40:53 millert Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /* @@ -811,12 +811,14 @@ sdgetdisklabel(dev, sd) /* as long as it's not 0 - readdisklabel divides by it (?) */ } + lp->d_type = DTYPE_SCSI; if (sd->type == T_OPTICAL) - strncpy(lp->d_typename, "SCSI optical", 16); + strncpy(lp->d_typename, "SCSI optical", + sizeof(lp->d_typename) - 1); else - strncpy(lp->d_typename, "SCSI disk", 16); - lp->d_type = DTYPE_SCSI; - strncpy(lp->d_packname, "fictitious", 16); + strncpy(lp->d_typename, "SCSI disk", + sizeof(lp->d_typename) - 1); + strncpy(lp->d_packname, "fictitious", sizeof(lp->d_packname) - 1); lp->d_secperunit = sd->params.disksize; lp->d_rpm = 3600; lp->d_interleave = 1; |