From 18d1bf125b75c5211aefd678c36d622fef28f59f Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Tue, 3 Jun 2008 12:06:37 +0000 Subject: [PATCH 1/1] Minor tweaks to utils.c 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 | 4 ++-- pppd/utils.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pppd/pppd.h b/pppd/pppd.h index cfb3a68..ae38f67 100644 --- a/pppd/pppd.h +++ b/pppd/pppd.h @@ -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)); diff --git a/pppd/utils.c b/pppd/utils.c index 44f2e73..062b17e 100644 --- a/pppd/utils.c +++ b/pppd/utils.c @@ -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 #include @@ -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; -- 2.39.2