From bcb41e7c822247e67d1553c633fb89f07d6aaa89 Mon Sep 17 00:00:00 2001 From: bfernhomberg Date: Fri, 18 Jun 2004 07:56:04 +0000 Subject: [PATCH] fix papd.conf parsing problems with consecutive ':' and missing newline --- etc/papd/printcap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/etc/papd/printcap.c b/etc/papd/printcap.c index 9bc00446..f7282030 100644 --- a/etc/papd/printcap.c +++ b/etc/papd/printcap.c @@ -1,5 +1,5 @@ /* - * $Id: printcap.c,v 1.9 2003-02-17 01:33:01 srittau Exp $ + * $Id: printcap.c,v 1.9.6.1 2004-06-18 07:56:04 bfernhomberg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -118,6 +118,10 @@ int getprent( cap, bp, bufsize ) for (;;) { switch (c = getc(pfp)) { case EOF: + if (bp != tbuf) { + *bp = '\0'; + return(1); + } fclose(pfp); pfp = NULL; return(0); @@ -347,7 +351,7 @@ tskip(bp) while (*bp && *bp != ':') bp++; - if (*bp == ':') + while (*bp && *bp == ':') bp++; return (bp); } -- 2.39.2