]> arthur.barton.de Git - netatalk.git/commitdiff
Fix off-by-one error in my_fgets() which is used to process PPD files.
authormorgana <morgana>
Thu, 15 Jan 2009 22:01:26 +0000 (22:01 +0000)
committermorgana <morgana>
Thu, 15 Jan 2009 22:01:26 +0000 (22:01 +0000)
etc/papd/ppd.c

index 120ff74c5fd5280ad27fc779e9e29a14763add73..4e30e1b4f8dfa155d1a0934e2c9c9d435ba4245e 100644 (file)
@@ -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')