]> git.saurik.com Git - apple/network_cmds.git/blobdiff - rtadvd.tproj/advcap.c
network_cmds-596.tar.gz
[apple/network_cmds.git] / rtadvd.tproj / advcap.c
index 2c9e34da0a955368003cb75c6dc870d5e5949c8f..33b6fae33635350adf2e48b428bf489898440a9d 100644 (file)
 #include <ctype.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <syslog.h>
 #include <errno.h>
 #include <string.h>
 #include "pathnames.h"
+#include "rtadvd_logging.h"
 
 #ifndef BUFSIZ
 #define        BUFSIZ          1024
@@ -165,8 +165,7 @@ getent(bp, name, cp)
                tf = open(RM = cp, O_RDONLY);
        }
        if (tf < 0) {
-               syslog(LOG_INFO,
-                      "<%s> open: %s", __func__, strerror(errno));
+               infolog("<%s> open: %s", __func__, strerror(errno));
                return (-2);
        }
        for (;;) {
@@ -188,9 +187,9 @@ getent(bp, name, cp)
                                }
                                break;
                        }
-                       if (cp >= bp + BUFSIZ) {
+                       if (cp >= bp + BUFSIZ - 1) {
                                write(STDERR_FILENO, "Remcap entry too long\n",
-                                     23);
+                                     22);
                                break;
                        } else
                                *cp++ = c;