From 88b57acc8f4a09385018f38a2ec15cb242d5c1c5 Mon Sep 17 00:00:00 2001 From: Stathis Kamperis Date: Wed, 15 Aug 2007 04:54:54 +0300 Subject: [PATCH] Fix some comments and don't print spaces in ata model --- fileops/readwd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fileops/readwd.c b/fileops/readwd.c index 04dda49..c32072c 100644 --- a/fileops/readwd.c +++ b/fileops/readwd.c @@ -66,14 +66,19 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* print the model */ + /* magic for little endian archs + * FIXME: add #ifdef condition for little endian archs + */ for (i = 0; i < sizeof(inbuf.inqbuf.atap_model); i+=2) { p = (u_int16_t *) (inbuf.inqbuf.atap_model + i); *p = ntohs(*p); } + /* print the model (trim spaces when printing) */ for (i = 0; i < sizeof(inbuf.inqbuf.atap_model); i++) + if (inbuf.inqbuf.atap_model[i] != ' ') printf("%c", inbuf.inqbuf.atap_model[i]); + printf("\n"); /* close file descriptor */ close(fd); -- 2.11.4.GIT