Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/usr.sbin/amd/libamu Pull up revisions 1.6-1.7 (requeste...
details: https://anonhg.NetBSD.org/src/rev/281fd575cf7d
branches: netbsd-1-4
changeset: 471118:281fd575cf7d
user: he <he%NetBSD.org@localhost>
date: Thu Oct 19 17:04:48 2000 +0000
description:
Pull up revisions 1.6-1.7 (requested by he):
Format string cleanup.
diffstat:
usr.sbin/amd/libamu/xutil.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diffs (72 lines):
diff -r 31869d28efe1 -r 281fd575cf7d usr.sbin/amd/libamu/xutil.c
--- a/usr.sbin/amd/libamu/xutil.c Thu Oct 19 17:04:46 2000 +0000
+++ b/usr.sbin/amd/libamu/xutil.c Thu Oct 19 17:04:48 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xutil.c,v 1.3.2.2 2000/01/23 12:16:27 he Exp $ */
+/* $NetBSD: xutil.c,v 1.3.2.3 2000/10/19 17:04:48 he Exp $ */
/*
* Copyright (c) 1997-1999 Erez Zadok
@@ -82,7 +82,8 @@
#endif /* DEBUG_MEM */
/* forward definitions */
-static void real_plog(int lvl, char *fmt, va_list vargs);
+static void real_plog(int lvl, const char *fmt, va_list vargs)
+ __attribute__((__format__(__printf__, 2, 0)));
#ifdef DEBUG
/*
@@ -283,10 +284,13 @@
* 'e' never gets longer than maxlen characters.
*/
static void
-expand_error(char *f, char *e, int maxlen)
+expand_error(const char *f, char *e, int maxlen)
{
+#ifndef HAVE_STRERROR
extern int sys_nerr;
- char *p, *q;
+#endif
+ const char *p;
+ char *q;
int error = errno;
int len = 0;
@@ -378,7 +382,7 @@
void
-dplog(char *fmt, ...)
+dplog(const char *fmt, ...)
{
va_list ap;
@@ -393,7 +397,7 @@
void
-plog(int lvl, char *fmt, ...)
+plog(int lvl, const char *fmt, ...)
{
va_list ap;
@@ -407,7 +411,7 @@
static void
-real_plog(int lvl, char *fmt, va_list vargs)
+real_plog(int lvl, const char *fmt, va_list vargs)
{
char msg[1024];
char efmt[1024];
@@ -430,7 +434,8 @@
* to 1023 (including the '\0').
*
*/
- vsnprintf(ptr, 1023, efmt, vargs);
+ fmt = efmt;
+ vsnprintf(ptr, 1023, fmt, vargs);
msg[1022] = '\0'; /* null terminate, to be sure */
ptr += strlen(ptr);
Home |
Main Index |
Thread Index |
Old Index