Navigation


Changeset 1093:44f3e48dfe27 in freeDiameter for libfdcore/endpoints.c


Ignore:
Timestamp:
May 6, 2013, 5:33:22 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Align the behavior of all fd_*dump functions wrt final \n

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/endpoints.c

    r1085 r1093  
    287287DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump_one, struct fd_endpoint * ep )
    288288{
    289         size_t o = 0;
    290         if (!offset)
    291                 offset=&o;
     289        FD_DUMP_HANDLE_OFFSET();
    292290       
    293291        CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{ep}(@%p): ", ep), return NULL);
    294292       
    295293        if (!ep) {
    296                 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "INVALID/NULL\n"), return NULL);
     294                CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "INVALID/NULL"), return NULL);
    297295                return *buf;
    298296        }
     
    311309{
    312310        struct fd_list * li;
    313         size_t o = 0;
    314         if (!offset)
    315                 offset=&o;
    316        
    317         CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%*s{eps}(@%p):\n", indent, "", eps), return NULL);
     311       
     312        FD_DUMP_HANDLE_OFFSET();
     313       
     314        CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%*s{eps}(@%p):", indent, "", eps), return NULL);
    318315        if (eps) {
    319316                for (li = eps->next; li != eps; li = li->next) {
    320317                        struct fd_endpoint * ep = (struct fd_endpoint *)li;
    321                         CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%*s", indent+1, ""), return NULL);
     318                        CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n%*s", indent+1, ""), return NULL);
    322319                        CHECK_MALLOC_DO( fd_ep_dump_one( FD_DUMP_STD_PARAMS, ep ), return NULL);
    323                         CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n"), return NULL);
    324                 }
    325         }
    326 }
    327        
     320                }
     321        }
     322}
     323       
Note: See TracChangeset for help on using the changeset viewer.