From: Chip Salzenberg Date: Sun, 15 Dec 1996 05:38:45 +0000 (+1200) Subject: Eliminate PerlIO warnings when setting cnt to -1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=159bba365a4935ff8f978d49b5bf733329e27959;p=p5sagit%2Fp5-mst-13.2.git Eliminate PerlIO warnings when setting cnt to -1 --- diff --git a/perlio.c b/perlio.c index 55d5f17..a1e6ff0 100644 --- a/perlio.c +++ b/perlio.c @@ -145,7 +145,7 @@ PerlIO_set_cnt(f,cnt) PerlIO *f; int cnt; { - if (cnt < 0) + if (cnt < -1) warn("Setting cnt to %d\n",cnt); #if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE) FILE_cnt(f) = cnt; @@ -164,8 +164,8 @@ int cnt; #ifdef FILE_bufsiz char *e = (char *)(FILE_base(f) + FILE_bufsiz(f)); int ec = e - ptr; - if (ptr > e) - warn("Setting ptr %p > base %p\n",ptr, FILE_base(f)+FILE_bufsiz(f)); + if (ptr > e + 1) + warn("Setting ptr %p > end+1 %p\n", ptr, e + 1); if (cnt != ec) warn("Setting cnt to %d, ptr implies %d\n",cnt,ec); #endif