Fixes the following warning:

mountd-2016-12-19-dd5799c9/mount.c: In function 'mount_dev_get_property':
mountd-2016-12-19-dd5799c9/mount.c:454:3: error: 'model' undeclared (first use 
in this function)
   model[strlen(prop_val) - 1] = '\0';
   ^

Signed-off-by: Florian Fainelli <f.faine...@gmail.com>
---
 mount.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mount.c b/mount.c
index fd5d073ca3eb..9607acdd8c5a 100644
--- a/mount.c
+++ b/mount.c
@@ -532,8 +532,10 @@ static void mount_dev_add(char *dev)
                if(!fp)
                        snprintf(sector_size, 64, "unknown");
                else {
-                       fgets(sector_size, 64, fp);
-                       sector_size[strlen(sector_size) - 1] = '\0';
+                       if (!fgets(sector_size, 64, fp))
+                               snprintf(sector_size, 64, "unknown");
+                       else
+                               sector_size[strlen(sector_size) - 1] = '\0';
                        fclose(fp);
                }
                snprintf(tmp, 64, "/dev/%s", dev);
-- 
2.9.3


_______________________________________________
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev

Reply via email to