X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=lib%2Fdebug.c;h=903c7931c492578be00411d846571481ce5c57b3;hb=fed9094cd8cda69605d0c103acd14308379b6eb0;hp=485e29a46234e62e4d49a1ab169369dee0c9fdc0;hpb=17a43cf2205a933169e11bc9280431577a183e65;p=radsecproxy.git diff --git a/lib/debug.c b/lib/debug.c index 485e29a..903c793 100644 --- a/lib/debug.c +++ b/lib/debug.c @@ -1,12 +1,14 @@ -/* See the file COPYING for licensing information. */ +/* Copyright 2011 NORDUnet A/S. All rights reserved. + See LICENSE for licensing information. */ #if defined HAVE_CONFIG_H #include #endif +#include #include #include -#include +#include #include #include #include "debug.h" @@ -14,25 +16,22 @@ void rs_dump_packet (const struct rs_packet *pkt) { - const RADIUS_PACKET *p = pkt->rpkt; - assert(p); + const RADIUS_PACKET *p = NULL; - fprintf (stderr, "\tCode: %u, Identifier: %u, Lenght: %u\n", + if (!pkt || !pkt->rpkt) + return; + p = pkt->rpkt; + + fprintf (stderr, "\tCode: %u, Identifier: %u, Lenght: %zu\n", p->code, p->id, - p->data_len); + p->sizeof_data); 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;