From f0decfde127175d85b4d71b2889e95d37a779aa4 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/avrdude@538 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 4 ++++ butterfly.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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);