Fix clang-tidy unused variable warning (issue #5, part 3).

https://github.com/fltk/fltk/issues/5
This commit is contained in:
Albrecht Schlosser 2018-12-15 13:27:39 +01:00
parent 9ea0d4ccbc
commit 2e6a4eb69a

View File

@ -1239,9 +1239,9 @@ static bool use_monitors_xml(float &factor) {
FILE *in = fopen(path, "r");
if (!in) return false;
p = fgets(line, sizeof(line), in);
if (strstr(line, "<monitors version=\"2\">")) {
if (p && strstr(line, "<monitors version=\"2\">")) {
while (fgets(line, sizeof(line), in)) {
if( (p = strstr(line, "<scale>")) && strstr(p, "</scale>") ) {
if ( (p = strstr(line, "<scale>")) && strstr(p, "</scale>") ) {
p += 7;
sscanf(p, "%f", &factor);
if (factor == 2) { found = true; break; }