From 5a1bf060c11af0f35d6188e547fe53cb1b4c8c11 Mon Sep 17 00:00:00 2001 From: Rod Grimes Date: Tue, 22 Feb 1994 22:13:37 +0000 Subject: [PATCH] More clean up of the drive Id string, trancate trailing spaces. --- sys/i386/isa/wd.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c index c523f5938b..04cd82c8fe 100644 --- a/sys/i386/isa/wd.c +++ b/sys/i386/isa/wd.c @@ -37,7 +37,7 @@ static int wdtest = 0; * SUCH DAMAGE. * * from: @(#)wd.c 7.2 (Berkeley) 5/9/91 - * $Id: wd.c,v 1.30 1994/02/21 12:32:33 rgrimes Exp $ + * $Id: wd.c,v 1.31 1994/02/22 18:51:27 rgrimes Exp $ */ /* TODO: @@ -1110,12 +1110,18 @@ wdgetctlr(struct disk *du) p = (u_short *) (wp->wdp_model + i); *p = ntohs(*p); } - /* Clean up the wdp_model by converting nulls to spaces */ - for (i = 0; i < sizeof(wp->wdp_model); i++) { + /* + * Clean up the wdp_model by converting nulls to spaces, and + * then removing the trailing spaces. + */ + for (i=0; i < sizeof(wp->wdp_model); i++) { if (wp->wdp_model[i] == '\0') { wp->wdp_model[i] = ' '; } } + for (i=sizeof(wp->wdp_model)-1; i>=0 && wp->wdp_model[i]==' '; i--) { + wp->wdp_model[i] = '\0'; + } #ifdef WDDEBUG printf( -- 2.20.1