Fix the maxsize comparision in stk500v2_jtagmkII_recv(), it was off

by one.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@644 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
joerg_wunsch 2006-09-06 22:29:27 +00:00
parent f8796c29cc
commit b03ee73923
1 changed files with 2 additions and 2 deletions

View File

@ -306,10 +306,10 @@ static int stk500v2_jtagmkII_recv(PROGRAMMER * pgm, unsigned char msg[],
progname); progname);
return -1; return -1;
} }
if (rv > maxsize) { if (rv - 1 > maxsize) {
fprintf(stderr, fprintf(stderr,
"%s: stk500v2_jtagmkII_recv(): got %u bytes, have only room for %u bytes\n", "%s: stk500v2_jtagmkII_recv(): got %u bytes, have only room for %u bytes\n",
progname, (unsigned)rv, maxsize); progname, (unsigned)rv - 1, maxsize);
rv = maxsize; rv = maxsize;
} }
switch (jtagmsg[0]) { switch (jtagmsg[0]) {