From 085b645442153d9a1b9b035923e5888c447aba6c 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/avrdude@753 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 7 +++++++ ser_win32.c | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96101a4e..88500cdf 100644 --- a/ChangeLog +++ b/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/ser_win32.c b/ser_win32.c index 44a6d3fd..fdb49735 100644 --- a/ser_win32.c +++ b/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"); }