diff --git a/ChangeLog b/ChangeLog index 7e3b175c..d2a65525 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-10-20 Joerg Wunsch + + * butterfly.c: fix yet another sign extension bug. + 2005-10-14 Joerg Wunsch * avrdude.conf.in (ATmega8515): fix size of calibration diff --git a/butterfly.c b/butterfly.c index b64a3aca..ce3aad73 100644 --- a/butterfly.c +++ b/butterfly.c @@ -297,9 +297,9 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p) exit(1); }; butterfly_recv(pgm, &c, 1); - buffersize = c<<8; + buffersize = (unsigned int)(unsigned char)c<<8; butterfly_recv(pgm, &c, 1); - buffersize += c; + buffersize += (unsigned int)(unsigned char)c; fprintf(stderr, "Programmer supports buffered memory access with buffersize=%i bytes.\n", buffersize);