]> arthur.barton.de Git - netatalk.git/commitdiff
merge from HEAD: Fix off-by-one error in my_fgets() which is used to process PPD...
authordidg <didg>
Mon, 19 Jan 2009 02:23:16 +0000 (02:23 +0000)
committerdidg <didg>
Mon, 19 Jan 2009 02:23:16 +0000 (02:23 +0000)
etc/papd/ppd.c

index c4f7c69f88691d55a0953089abad4d08d90c7a35..2e1cf86cd2ffcad4aed8207e5c592a749f1895fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ppd.c,v 1.9.8.1.2.3 2008-11-14 10:04:52 didg Exp $
+ * $Id: ppd.c,v 1.9.8.1.2.4 2009-01-19 02:23:16 didg 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')