
Dear Guennadi,
In message alpine.DEB.1.00.0809031108220.6727@axis700.grange you wrote:
would become:
if (crc0_ok && !crc1_ok) { dev_current = 0; } else if (!crc0_ok && crc1_ok) { dev_current = 1;
If "0" is OK, then use "0"; if "1" is ok then use "1".
Your version: if "1" is OK then use "0", if "2" is OK then use "1" is more difficult to read.
[Or stick with the old identifiers, i. e. use 1 and 2 consistently, but don't mix 0/1 here and 1/2 there.]
Sorry, don't understand. This is the original code:
if (crc1_ok && !crc2_ok) { environment.data = addr1; environment.flags = flag1; environment.crc = crc1; curdev = 0; free (addr2);
Which looks to me like "if (crc1_ok...) {... curdev = 0;...}", which I tried to preserve. So, you would prefer me to _change_ it?
...except that that nor "curdev =0" is present anywhere, but instead the index "1" is used consistently: crc1_ok, addr1, flag1, crc1.
As far as I understand, with rc == 3 there is no DEVESIZE in the line, which doesn't look like a valid configuration line to me. The orginal code however accepted such lines and only dropped lines with rc < 3. I do not understand how the original code managed to work with rc == 3. As I thought this was a bug, I changed the test to "rc < 4", i.e., now I
Did you verify that is was a bug?
Best regards,
Wolfgang Denk