summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx4
1 files changed, 2 insertions, 2 deletions
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, "<width>")) && strstr(p, "</width>") ) {
sscanf(p + 7, "%d", &w);
- fgets(line, sizeof(line), in);
- p = strstr(line, "<height>");
+ p = fgets(line, sizeof(line), in);
+ if (p) p = strstr(line, "<height>");
if (p) sscanf(p+8, "%d", &h);
if (p && w == width && h == height) {
found = true;