From d5e3d46c8a6ffd2e62c722231541d59765c95a7a Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Wed, 16 May 2007 03:14:42 +0000 Subject: Add missing ssize_t rlen, used when DEBUG is defined, and only define c when DEBUG is undefined. From Pav Lucistnik . While here, correct format strings to match ssize_t. OK moritz@. --- usr.bin/tip/aculib/hayes.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/tip/aculib/hayes.c b/usr.bin/tip/aculib/hayes.c index e7139435b6b..32bf2a0b9d2 100644 --- a/usr.bin/tip/aculib/hayes.c +++ b/usr.bin/tip/aculib/hayes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hayes.c,v 1.13 2006/03/17 19:17:13 moritz Exp $ */ +/* $OpenBSD: hayes.c,v 1.14 2007/05/16 03:14:41 ray Exp $ */ /* $NetBSD: hayes.c,v 1.6 1997/02/11 09:24:17 mrg Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)hayes.c 8.1 (Berkeley) 6/6/93"; #endif -static const char rcsid[] = "$OpenBSD: hayes.c,v 1.13 2006/03/17 19:17:13 moritz Exp $"; +static const char rcsid[] = "$OpenBSD: hayes.c,v 1.14 2007/05/16 03:14:41 ray Exp $"; #endif /* not lint */ /* @@ -248,10 +248,15 @@ static void goodbye(void) { int len; - char c; tcflush(FD, TCIOFLUSH); if (hay_sync()) { +#ifdef DEBUG + ssize_t rlen; +#else + char c; +#endif + sleep(1); #ifndef DEBUG tcflush(FD, TCIOFLUSH); @@ -270,7 +275,7 @@ goodbye(void) printf("goodbye1: len=%d -- ", len); rlen = read(FD, dumbuf, min(len, DUMBUFLEN)); dumbuf[rlen] = '\0'; - printf("read (%d): %s\r\n", rlen, dumbuf); + printf("read (%zd): %s\r\n", rlen, dumbuf); #endif write(FD, "ATv1\r", 5); sleep(1); @@ -279,7 +284,7 @@ goodbye(void) printf("goodbye2: len=%d -- ", len); rlen = read(FD, dumbuf, min(len, DUMBUFLEN)); dumbuf[rlen] = '\0'; - printf("read (%d): %s\r\n", rlen, dumbuf); + printf("read (%zd): %s\r\n", rlen, dumbuf); #endif } tcflush(FD, TCIOFLUSH); -- cgit v1.2.3