Add an error code.
[radsecproxy.git] / lib / debug.c
index 485e29a..3d3a2b9 100644 (file)
@@ -1,4 +1,5 @@
-/* See the file COPYING for licensing information.  */
+/* Copyright 2011 NORDUnet A/S. All rights reserved.
+   See the file COPYING for licensing information.  */
 
 #if defined HAVE_CONFIG_H
 #include <config.h>
 void
 rs_dump_packet (const struct rs_packet *pkt)
 {
-  const RADIUS_PACKET *p = pkt->rpkt;
-  assert(p);
+  const RADIUS_PACKET *p = NULL;
+
+  if (!pkt || !pkt->rpkt)
+    return;
+  p = pkt->rpkt;
 
   fprintf (stderr, "\tCode: %u, Identifier: %u, Lenght: %u\n",
           p->code,
@@ -24,15 +28,9 @@ rs_dump_packet (const struct rs_packet *pkt)
   fflush (stderr);
 }
 
-void
-rs_dump_attr (const struct rs_attr *attr)
-{
-  vp_printlist (stderr, attr->vp);
-}
-
 #if defined DEBUG
 int
-rs_debug (const char *fmt, ...)
+_rs_debug (const char *fmt, ...)
 {
   int n;
   va_list args;