Mercurial > hg > freeDiameter
diff libfdproto/dictionary_functions.c @ 1093:44f3e48dfe27
Align the behavior of all fd_*dump functions wrt final \n
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Mon, 06 May 2013 16:33:22 +0800 |
parents | 7d7266115a34 |
children | d4371b7aa0ff |
line wrap: on
line diff
--- a/libfdproto/dictionary_functions.c Mon May 06 11:30:34 2013 +0800 +++ b/libfdproto/dictionary_functions.c Mon May 06 16:33:22 2013 +0800 @@ -161,10 +161,8 @@ sSA6 sin6; } s; uint16_t fam; - size_t o = 0; - if (!offset) - offset = &o; + FD_DUMP_HANDLE_OFFSET(); memset(&s, 0, sizeof(s)); @@ -212,9 +210,8 @@ /* Dump the AVP in a natural human-readable format. This dumps the complete length of the AVP, it is up to the caller to truncate if needed */ DECLARE_FD_DUMP_PROTOTYPE(fd_dictfct_UTF8String_dump, union avp_value * avp_value) { - size_t o = 0, l; - if (!offset) - offset = &o; + size_t l; + FD_DUMP_HANDLE_OFFSET(); l = avp_value->os.len; /* Just in case the string ends in invalid UTF-8 chars, we shorten it */ @@ -304,12 +301,10 @@ DECLARE_FD_DUMP_PROTOTYPE(fd_dictfct_Time_dump, union avp_value * avp_value) { - size_t o = 0; time_t val; struct tm conv; - if (!offset) - offset = &o; + FD_DUMP_HANDLE_OFFSET(); if (avp_value->os.len != 4) { CHECK_MALLOC_DO( fd_dump_extend(FD_DUMP_STD_PARAMS, "[invalid length: %zd]", avp_value->os.len), return NULL);