Ignore:
Timestamp:
11/29/18 13:37:20 (2 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop
Children:
50e9c6b
Parents:
54642da (diff), fdf23b8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of git://github.com/jacobvw/libtrace into jacobvw-master

Conflicts:

lib/format_linux_ring.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_helper.c

    r412550d rd7d3267  
    3939#include "format_helper.h"
    4040
    41 #include <assert.h>
    4241#include <stdarg.h>
    4342
     
    6968        struct timeval tv;
    7069
    71         assert(trace != NULL);
    72         assert(packet != NULL);
    73        
     70        if (!trace) {
     71                fprintf(stderr, "NULL trace passed into trace_event_device()\n");
     72                event.type = TRACE_EVENT_TERMINATE;
     73                return event;
     74        }
     75        if (!packet) {
     76                trace_set_err(trace, TRACE_ERR_NULL_PACKET, "NULL packet passed into trace_event_device()");
     77                event.type = TRACE_EVENT_TERMINATE;
     78                return event;
     79        }
     80
    7481        FD_ZERO(&rfds);
    7582        FD_ZERO(&rfds_param);
     
    292299        va_list va;
    293300        va_start(va,msg);
    294         assert(errcode != 0 && "An error occurred, but it is unknown what it is");
     301
     302        if (errcode == 0) {
     303                fprintf(stderr, "An error occurred, but it is unknown what it is");
     304                return;
     305        }
     306
    295307        trace->err.err_num=errcode;
    296308        if (errcode>0) {
     
    315327        va_list va;
    316328        va_start(va,msg);
    317         assert(errcode != 0 && "An error occurred, but it is unknown what it is");
     329        if (errcode == 0) {
     330                fprintf(stderr, "An error occurred, but is is unknown what is is");
     331                return;
     332        }
    318333        trace->err.err_num=errcode;
    319334        if (errcode>0) {
Note: See TracChangeset for help on using the changeset viewer.