]> arthur.barton.de Git - netatalk.git/blobdiff - etc/papd/file.c
merge papd changes from HEAD
[netatalk.git] / etc / papd / file.c
index 0339158cd2ae37e1854aa7000719f1d617f05cb1..1517c0c380c1b2ba46c363473b6a2e1331957103 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.6 2001-06-25 20:13:45 rufustfirefly Exp $
+ * $Id: file.c,v 1.9.12.1 2009-02-03 08:25:00 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -9,7 +9,7 @@
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
-#include <sys/syslog.h>
+#include <atalk/logger.h>
 #include <sys/param.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -17,6 +17,8 @@
 
 #include "file.h"
 
+/* 
+*/
 int markline( pf, start, linelength, crlflength )
     char               **start;
     int                        *linelength, *crlflength;
@@ -53,8 +55,15 @@ int markline( pf, start, linelength, crlflength )
     (p[*crlflength]=='\r' || p[*crlflength]=='\n')) {
        (*crlflength)++;
     }
+    
+    if (!*crlflength) {
+        /* line is way too long, something fishy is going on, give up */
+        LOG(log_error, logtype_papd, "markline: no crlf in comment, give up" );
+        return( -2 );
+    }
 
-    return *linelength;
+    /* success, return 1 */
+    return( 1 );
 }
 
 void morespace( pf, data, len )