From 15d320cbfef626a0c5178866826420c1c8f12113 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Mon, 29 Oct 2007 21:51:07 +0000 Subject: [PATCH] bug #21076: -vvvv serial receive prints are empty in Win32 build In ser_recv(): Drop the essentially unused variable "len", and use the variable "read" in order to track how many bytes have just been read in. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@753 81a1dc3b-b13d-400b-aceb-764788c761c2 --- avrdude/ChangeLog | 7 +++++++ avrdude/ser_win32.c | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/avrdude/ChangeLog b/avrdude/ChangeLog index 96101a4e..88500cdf 100644 --- a/avrdude/ChangeLog +++ b/avrdude/ChangeLog @@ -1,3 +1,10 @@ +2007-10-29 Joerg Wunsch + + bug #21076: -vvvv serial receive prints are empty in Win32 build + * ser_win32.c (ser_recv): Drop the essentially unused variable + "len", and use the variable "read" in order to track how many + bytes have just been read in. + 2007-10-29 Joerg Wunsch bug #21145: atmega329p not recognized diff --git a/avrdude/ser_win32.c b/avrdude/ser_win32.c index 44a6d3fd..fdb49735 100644 --- a/avrdude/ser_win32.c +++ b/avrdude/ser_win32.c @@ -245,7 +245,6 @@ static int ser_recv(union filedescriptor *fd, unsigned char * buf, size_t buflen { unsigned char c; unsigned char * p = buf; - size_t len = 0; DWORD read; HANDLE hComPort=(HANDLE)fd->pfd; @@ -282,7 +281,7 @@ static int ser_recv(union filedescriptor *fd, unsigned char * buf, size_t buflen { fprintf(stderr, "%s: Recv: ", progname); - while (len) { + while (read) { c = *p; if (isprint(c)) { fprintf(stderr, "%c ", c); @@ -293,7 +292,7 @@ static int ser_recv(union filedescriptor *fd, unsigned char * buf, size_t buflen fprintf(stderr, "[%02x] ", c); p++; - len--; + read--; } fprintf(stderr, "\n"); }