Massively cleaned up #include's, so they're in a consistent
[freeradius.git] / src / lib / log.c
index a00f91c..089220b 100644 (file)
@@ -2,16 +2,29 @@
  * log.c       Functions in the library call radlib_log() which
  *             sets a global error string "char *librad_errstr".
  *
- * Version:    @(#)log.c  1.00  25-Oct-1998  miquels@cistron.nl
+ * Version:    $Id$
  *
+ *   This library is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU Lesser General Public
+ *   License as published by the Free Software Foundation; either
+ *   version 2.1 of the License, or (at your option) any later version.
+ *
+ *   This library is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *   Lesser General Public License for more details.
+ *
+ *   You should have received a copy of the GNU Lesser General Public
+ *   License along with this library; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ * Copyright 2000,2006  The FreeRADIUS server project
  */
 
-#include "autoconf.h"
+#include <freeradius-devel/ident.h>
+RCSID("$Id$")
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
+#include <freeradius-devel/libradius.h>
 
 char librad_errstr[1024];
 
@@ -22,25 +35,20 @@ char librad_errstr[1024];
  *  This also isn't multithreaded-safe, so it'll have to be changed
  *  in the future.
  */
-void librad_log(char *fmt, ...)
+void librad_log(const char *fmt, ...)
 {
        va_list ap;
        char my_errstr[sizeof(librad_errstr)];
 
        va_start(ap, fmt);
-
-#ifdef HAVE_VSNPRINTF
        vsnprintf(my_errstr, sizeof(my_errstr), fmt, ap);
-#else
-       vsprintf(my_errstr, fmt, ap);
-#endif
        strcpy(librad_errstr, my_errstr);
        va_end(ap);
 }
 
-void librad_perror(char *fmt, ...)
+void librad_perror(const char *fmt, ...)
 {
-       va_list *ap;
+       va_list ap;
 
        va_start(ap, fmt);
        vfprintf(stderr, fmt, ap);