From a1c528dbe2c2033dabe1a80d5f8068dae2e13357 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Thu, 20 Oct 2005 11:36:19 +0000 Subject: [PATCH] Fix yet another sign extension bug introduced by renaming "unsigned char" to "char". git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@538 81a1dc3b-b13d-400b-aceb-764788c761c2 --- avrdude/ChangeLog | 4 ++++ avrdude/butterfly.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog index 7e3b175c..d2a65525 100644 --- a/avrdude/ChangeLog +++ b/avrdude/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/avrdude/butterfly.c b/avrdude/butterfly.c index b64a3aca..ce3aad73 100644 --- a/avrdude/butterfly.c +++ b/avrdude/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);