From 9c9169a9727a658c2e8e911b14a35c1525e08ca6 Mon Sep 17 00:00:00 2001 From: Arnaud Ferraris Date: Sun, 13 Dec 2020 00:55:22 +0100 Subject: [PATCH] manager: get rid of compiler warnings --- src/manager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/manager.c b/src/manager.c index bc90985..26e0d67 100644 --- a/src/manager.c +++ b/src/manager.c @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) { struct EG25Manager manager; char compatible[32]; - int fd; + int fd, ret; memset(&manager, 0, sizeof(manager)); manager.at_fd = -1; @@ -172,8 +172,8 @@ int main(int argc, char *argv[]) g_critical("Unable to read 'compatible' string from device tree"); return 1; } - read(fd, compatible, sizeof(compatible)); - if (!strstr(compatible, "pine64,pinephone-1.2")) + ret = read(fd, compatible, sizeof(compatible)); + if (ret > 0 && !strstr(compatible, "pine64,pinephone-1.2")) manager.braveheart = TRUE; close(fd);