From: Ken Raeburn Date: Wed, 29 Sep 1999 02:06:36 +0000 (+0000) Subject: replace char arrays with macros for gcc format checking; provide format str to syslog X-Git-Tag: krb5-1.2-beta1~216 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=483b0385e5850db00e44f83ed3e0b959e803fd34;p=krb5.git replace char arrays with macros for gcc format checking; provide format str to syslog git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11856 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm5/ChangeLog b/src/lib/kadm5/ChangeLog index d7c4b36e9..74f98a4e5 100644 --- a/src/lib/kadm5/ChangeLog +++ b/src/lib/kadm5/ChangeLog @@ -1,3 +1,13 @@ +1999-09-28 Ken Raeburn + + * logger.c (lspec_parse_err_1, lspec_parse_err_2, log_file_err, + log_device_err, log_ufo_string, log_emerg_string, + log_alert_string, log_crit_string, log_err_string, + log_warning_string, log_notice_string, log_info_string, + log_debug_string): Replace char arrays with macros. + (klog_com_err_proc, klog_vsyslog): When calling syslog, supply %s + format string. + 1999-09-23 Ken Raeburn * logger.c (DEVICE_PRINT, klog_com_err_proc, klog_vsyslog): Use diff --git a/src/lib/kadm5/logger.c b/src/lib/kadm5/logger.c index 36f16a156..606a4275d 100644 --- a/src/lib/kadm5/logger.c +++ b/src/lib/kadm5/logger.c @@ -60,19 +60,19 @@ #define LOG_ERR 0 #endif /* LOG_ERR */ -static const char lspec_parse_err_1[] = "%s: cannot parse <%s>\n"; -static const char lspec_parse_err_2[] = "%s: warning - logging entry syntax error\n"; -static const char log_file_err[] = "%s: error writing to %s\n"; -static const char log_device_err[] = "%s: error writing to %s device\n"; -static const char log_ufo_string[] = "???"; -static const char log_emerg_string[] = "EMERGENCY"; -static const char log_alert_string[] = "ALERT"; -static const char log_crit_string[] = "CRITICAL"; -static const char log_err_string[] = "Error"; -static const char log_warning_string[] = "Warning"; -static const char log_notice_string[] = "Notice"; -static const char log_info_string[] = "info"; -static const char log_debug_string[] = "debug"; +#define lspec_parse_err_1 "%s: cannot parse <%s>\n" +#define lspec_parse_err_2 "%s: warning - logging entry syntax error\n" +#define log_file_err "%s: error writing to %s\n" +#define log_device_err "%s: error writing to %s device\n" +#define log_ufo_string "?\?\?" /* nb: avoid trigraphs */ +#define log_emerg_string "EMERGENCY" +#define log_alert_string "ALERT" +#define log_crit_string "CRITICAL" +#define log_err_string "Error" +#define log_warning_string "Warning" +#define log_notice_string "Notice" +#define log_info_string "info" +#define log_debug_string "debug" /* * Output logging. @@ -318,7 +318,7 @@ klog_com_err_proc(whoami, code, format, ap) log_control.log_entries[lindex].lsu_severity; /* Log the message with our header trimmed off */ - syslog(log_pri, syslogp); + syslog(log_pri, "%s", syslogp); break; #endif /* HAVE_SYSLOG */ default: @@ -910,7 +910,7 @@ klog_vsyslog(priority, format, arglist) */ /* Log the message with our header trimmed off */ - syslog(priority, syslogp); + syslog(priority, "%s", syslogp); break; #endif /* HAVE_SYSLOG */ default: