From f9255e375cb4751404e33837cdddd6f2d31d96b9 Mon Sep 17 00:00:00 2001
From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
Date: Thu, 21 Feb 2019 15:19:02 +0100
Subject: Remove compilation warning with -Wunused-result
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Warning was: ignoring return value of ‘char* fgets(char*, int, FILE*)’
---
src/drivers/X11/Fl_X11_Screen_Driver.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'src/drivers')
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
index 660ed03b0..1afbebacd 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -1223,8 +1223,8 @@ static bool usemonitors_xml(float &factor, int width, int height) {
}
if ( in_config && (p = strstr(line, "")) && strstr(p, "") ) {
sscanf(p + 7, "%d", &w);
- fgets(line, sizeof(line), in);
- p = strstr(line, "");
+ p = fgets(line, sizeof(line), in);
+ if (p) p = strstr(line, "");
if (p) sscanf(p+8, "%d", &h);
if (p && w == width && h == height) {
found = true;
--
cgit v1.2.3