]> arthur.barton.de Git - netatalk.git/blobdiff - etc/papd/printcap.c
- merge branch-netatalk-afp-3x-dev, HEAD was tagged before
[netatalk.git] / etc / papd / printcap.c
index 15b3b4e5ab54ba465dbac30de41a9386bb09e093..19ed788331cc8351de1a76774a9fe532b0930f33 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: printcap.c,v 1.8 2002-08-20 20:25:54 srittau Exp $
+ * $Id: printcap.c,v 1.10 2005-04-28 20:49:49 bfernhomberg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
-#ifndef lint
-static char sccsid[] = "@(#)printcap.c 5.7 (Berkeley) 3/4/91";
-#endif /* not lint */
-
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
@@ -122,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);
@@ -351,7 +351,7 @@ tskip(bp)
 
        while (*bp && *bp != ':')
                bp++;
-       if (*bp == ':')
+       while (*bp && *bp == ':')
                bp++;
        return (bp);
 }