remove unwanted \n from cdrom model name
This commit is contained in:
parent
be662de749
commit
f5120f7acf
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user