remove unwanted \n from cdrom model name

This commit is contained in:
Sergey Bolshakov 2007-08-02 20:08:13 +04:00
parent be662de749
commit f5120f7acf

View File

@ -511,6 +511,8 @@ static void find_media(void)
strcat(path, "/device/model");
if ((f = fopen(path, "r")) != NULL) {
if (fgets(buf, sizeof(buf), f)) {
if(buf[strlen(buf)-1] == '\n')
buf[strlen(buf)-1] = 0;
tmp[count].model = strdup(buf);
}
fclose(f);
@ -551,6 +553,8 @@ static void find_media(void)
strcat(path, "/model");
if ((f = fopen(path, "r")) != NULL) {
if (fgets(buf, sizeof(buf), f)) {
if(buf[strlen(buf)-1] == '\n')
buf[strlen(buf)-1] = 0;
tmp[count].model = strdup(buf);
}
fclose(f);