From e884b16a26dc129e4eeb64b66448f467599cebe7 Mon Sep 17 00:00:00 2001 From: morgana Date: Thu, 15 Jan 2009 22:01:26 +0000 Subject: [PATCH] Fix off-by-one error in my_fgets() which is used to process PPD files. --- etc/papd/ppd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/papd/ppd.c b/etc/papd/ppd.c index 120ff74c..4e30e1b4 100644 --- a/etc/papd/ppd.c +++ b/etc/papd/ppd.c @@ -1,5 +1,5 @@ /* - * $Id: ppd.c,v 1.11 2008-11-14 10:29:08 didg Exp $ + * $Id: ppd.c,v 1.12 2009-01-15 22:01:26 morgana Exp $ * * Copyright (c) 1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -75,7 +75,7 @@ static char* my_fgets(buf, bufsize, stream) int p; /* uninitialized, OK 310105 */ size_t count = 0; - while (count < bufsize && EOF != (p=fgetc(stream))) { + while (count < (bufsize - 1) && EOF != (p=fgetc(stream))) { buf[count] = p; count++; if ( p == '\r' || p == '\n') -- 2.39.2