Comment 12 for bug 135738

Revision history for this message
In , Nico R. (n-roeser) wrote :

I haven’t read much of the code, only some bits in Monitor.c, Configint.h and scan.c. But …

    if (Monitor->widthmm <= 0 && Monitor->heightmm <= 0) {
 Monitor->widthmm = 10 * DDC->features.hsize;
 Monitor->heightmm = 10 * DDC->features.vsize;
    }

only overwrites the values if *both*, widthmm and heightmm, are <= 0. If I read the code correctly, this happens
a) if atof returned an error, or
b) if the user explicitly set a negative or zero value in the config file, or
c) if the value is not set in the config file at all.

Shouldn’t this be

    if (Monitor->widthmm <= 0 || Monitor->heightmm <= 0) {
 Monitor->widthmm = 10 * DDC->features.hsize;
 Monitor->heightmm = 10 * DDC->features.vsize;
    }

instead? Or – even better – check/set the values separately, one by one?