aboutsummaryrefslogtreecommitdiff
path: root/src/ata.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2011-01-08 12:06:54 -0500
committerKevin O'Connor <kevin@koconnor.net>2011-01-08 12:06:54 -0500
commit9e881a3821b045c9b75c64e9c349dc82b276df28 (patch)
treec711539acab1466efd5e2047557601d293f42340 /src/ata.c
parent3c241edf3d7ef29c21e63ab74cfc7cb6f4a92ab3 (diff)
downloadseabios-hppa-9e881a3821b045c9b75c64e9c349dc82b276df28.zip
seabios-hppa-9e881a3821b045c9b75c64e9c349dc82b276df28.tar.gz
seabios-hppa-9e881a3821b045c9b75c64e9c349dc82b276df28.tar.bz2
Extract space trimming code from ATA and use in USB and bootorder code.
Introduce function nullTrailingSpace() that nulls blank characters from the end of a string. Use this function in the ATA, USB MSC, and bootorder code.
Diffstat (limited to 'src/ata.c')
-rw-r--r--src/ata.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/ata.c b/src/ata.c
index e9a2aef..397e402 100644
--- a/src/ata.c
+++ b/src/ata.c
@@ -727,11 +727,7 @@ ata_extract_model(char *model, u32 size, u16 *buffer)
for (i=0; i<size/2; i++)
*(u16*)&model[i*2] = ntohs(buffer[27+i]);
model[size] = 0x00;
-
- // Trim trailing spaces from model name.
- for (i=size-1; i>0 && model[i] == 0x20; i--)
- model[i] = 0x00;
-
+ nullTrailingSpace(model);
return model;
}