]> git.ozlabs.org Git - ppp.git/commitdiff
Minor tweaks to utils.c
authorPaul Mackerras <paulus@samba.org>
Tue, 3 Jun 2008 12:06:37 +0000 (12:06 +0000)
committerPaul Mackerras <paulus@samba.org>
Tue, 3 Jun 2008 12:06:37 +0000 (12:06 +0000)
Add a const qualifier to the prefix arg for init_pr_log, and
use OUTCHAR in a couple of places in vslprintf instead of
explicitly putting things in the buffer.

pppd/pppd.h
pppd/utils.c

index cfb3a682b3800f2a74cac07b1373078125a9dc55..ae38f67f1261e7d12daffe91eff3ea92dd4c85a4 100644 (file)
@@ -39,7 +39,7 @@
  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: pppd.h,v 1.92 2007/06/19 02:08:35 carlsonj Exp $
+ * $Id: pppd.h,v 1.93 2008/06/03 12:06:37 paulus Exp $
  */
 
 /*
@@ -516,7 +516,7 @@ void notice __P((char *, ...));     /* log a notice-level message */
 void warn __P((char *, ...));  /* log a warning message */
 void error __P((char *, ...)); /* log an error message */
 void fatal __P((char *, ...)); /* log an error message and die(1) */
-void init_pr_log __P((char *, int));   /* initialize for using pr_log */
+void init_pr_log __P((const char *, int)); /* initialize for using pr_log */
 void pr_log __P((void *, char *, ...));        /* printer fn, output to syslog */
 void end_pr_log __P((void));   /* finish up after using pr_log */
 void dump_packet __P((const char *, u_char *, int));
index 44f2e73407c50d5fc89473dfe174be9323527185..062b17e4a8db64cc11e42c43ffe184219f313f51 100644 (file)
@@ -28,7 +28,7 @@
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#define RCSID  "$Id: utils.c,v 1.24 2004/11/04 10:02:26 paulus Exp $"
+#define RCSID  "$Id: utils.c,v 1.25 2008/06/03 12:06:37 paulus Exp $"
 
 #include <stdio.h>
 #include <ctype.h>
@@ -236,8 +236,8 @@ vslprintf(buf, buflen, fmt, args)
                base = 10;
                break;
            default:
-               *buf++ = '%'; --buflen;
-               *buf++ = 'l'; --buflen;
+               OUTCHAR('%');
+               OUTCHAR('l');
                --fmt;          /* so %lz outputs %lz etc. */
                continue;
            }
@@ -527,7 +527,7 @@ static int llevel;          /* level for logging */
 
 void
 init_pr_log(prefix, level)
-     char *prefix;
+     const char *prefix;
      int level;
 {
        linep = line;