[flashrom] [PATCH 5/6] improve output in case run_opcode fails

Michael Karcher flashrom at mkarcher.dialup.fu-berlin.de
Sat Apr 30 00:39:25 CEST 2011


Am Samstag, den 30.04.2011, 00:06 +0200 schrieb Stefan Tauner:
> > +			uint8_t i;
> > +			for(i=0; i<count; i++){
> > +				msg_pspew("%3d: 0x%02x\n", i,
> > data[i]);
> > +			}
> > +		}
> >  	}
> 
> self-NAK :)
> 
> uint8_t is too small and could result in an endless loop. oops. :(
> this should not happen normally, because devices supported by ichspi.c
> allow only 16B or 64B data lengths, but we could be called with
> something bigger i guess.
> how should this be solved?

use the same type as count for i. In this case: int.

Regards,
  Michael Karcher





More information about the flashrom mailing list