Ticket #120: libsyncml-05-printf-null.diff

File libsyncml-05-printf-null.diff, 53.9 kB (added by jerryyu, 1 year ago)
  • ./libsyncml/parser/sml_xml_assm.c

    old new  
    4141 
    4242static SmlBool _smlXmlAssemblerStartNodeNS(SmlXmlAssembler *assm, const char *name, const char *uri, SmlError **error) 
    4343{ 
    44         smlTrace(TRACE_INTERNAL, "%s: Starting \"%s\"", __func__, name); 
     44        smlTrace(TRACE_INTERNAL, "%s: Starting \"%s\"", __func__, name?name:"NULL"); 
    4545        int rc = xmlTextWriterStartElementNS(assm->writer, NULL, (xmlChar *)name, (xmlChar *)uri); 
    4646        if (rc < 0) { 
    4747        smlErrorSet(error, SML_ERROR_GENERIC, "Unable to start node"); 
     
    124124 
    125125SmlBool smlLocationAssemble(SmlLocation *location, SmlXmlAssembler *assm, const char *name, SmlError **error) 
    126126{ 
    127         smlTrace(TRACE_ENTRY, "%s(%p, %p, %s, %p)", __func__, location, assm, name, error); 
     127        smlTrace(TRACE_ENTRY, "%s(%p, %p, %s, %p)", __func__, location, assm, name?name:"NULL", error); 
    128128        smlAssert(assm); 
    129129        smlAssert(location); 
    130130         
     
    155155        return TRUE; 
    156156 
    157157error: 
    158         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     158        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    159159        return FALSE; 
    160160} 
    161161 
     
    193193        return TRUE; 
    194194 
    195195error: 
    196         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     196        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    197197        return FALSE; 
    198198} 
    199199 
     
    250250        return TRUE; 
    251251 
    252252error: 
    253         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     253        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    254254        return FALSE; 
    255255} 
    256256 
     
    302302        return TRUE; 
    303303 
    304304error: 
    305         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     305        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    306306        return FALSE; 
    307307} 
    308308 
     
    340340        return TRUE; 
    341341 
    342342error: 
    343         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     343        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    344344        return FALSE; 
    345345} 
    346346 
     
    401401        return TRUE; 
    402402 
    403403error: 
    404         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     404        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    405405        return FALSE; 
    406406} 
    407407 
     
    460460        return TRUE; 
    461461 
    462462error: 
    463         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     463        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    464464        return FALSE; 
    465465} 
    466466 
     
    491491        return TRUE; 
    492492 
    493493error: 
    494         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     494        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    495495        return FALSE; 
    496496} 
    497497 
     
    528528        return TRUE; 
    529529 
    530530error: 
    531         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     531        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    532532        return FALSE; 
    533533} 
    534534 
     
    589589        return TRUE; 
    590590 
    591591error: 
    592         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     592        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    593593        return FALSE; 
    594594} 
    595595 
     
    632632        return TRUE; 
    633633 
    634634error: 
    635         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     635        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    636636        return FALSE; 
    637637} 
    638638 
     
    765765        xmlBufferFree(assm->header_buffer); 
    766766        assm->header_buffer = NULL; 
    767767error: 
    768         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     768        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    769769        return FALSE; 
    770770} 
    771771 
     
    959959        return TRUE; 
    960960         
    961961error: 
    962         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     962        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    963963        return FALSE; 
    964964} 
    965965 
     
    994994        return TRUE; 
    995995         
    996996error: 
    997         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     997        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    998998        return FALSE; 
    999999} 
    10001000 
     
    10221022        return TRUE; 
    10231023         
    10241024error: 
    1025         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1025        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    10261026        return FALSE; 
    10271027} 
    10281028 
     
    12041204error_free_buffer: 
    12051205        xmlBufferFree(res->buffer); 
    12061206error: 
    1207         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1207        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    12081208        return FALSE; 
    12091209} 
    12101210 
     
    13321332        return TRUE; 
    13331333 
    13341334error: 
    1335         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1335        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    13361336        return FALSE; 
    13371337} 
    13381338 
     
    13581358                                        if (!cmdname) 
    13591359                                                goto error; 
    13601360                                } 
    1361                                 smlTrace(TRACE_INTERNAL, "opening node %s", cmdname); 
     1361                                smlTrace(TRACE_INTERNAL, "opening node %s", cmdname?cmdname:"NULL"); 
    13621362                                 
    13631363                                if (!_smlXmlAssemblerStartNode(assm, cmdname, error)) 
    13641364                                        goto error; 
     
    13851385        return TRUE; 
    13861386 
    13871387error: 
    1388         smlTrace(TRACE_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1388        smlTrace(TRACE_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    13891389        return FALSE; 
    13901390} 
    13911391 
     
    15371537         
    15381538        //FIXME ADD debug ifs 
    15391539        char *debugstr = smlPrintBinary(*data, *size); 
    1540         smlTrace(TRACE_INTERNAL, "Message Assembled: %s", debugstr); 
     1540        smlTrace(TRACE_INTERNAL, "Message Assembled: %s", debugstr?debugstr:"NULL"); 
    15411541        g_free(debugstr); 
    15421542         
    15431543        smlTrace(TRACE_EXIT, "%s", __func__); 
     
    15491549error_free_buffer: 
    15501550        xmlBufferFree(buffer); 
    15511551error: 
    1552         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1552        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    15531553        return FALSE; 
    15541554} 
    15551555 
     
    16651665        return assm; 
    16661666         
    16671667error: 
    1668         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1668        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    16691669        return NULL; 
    16701670} 
    16711671 
    16721672static SmlBool _smlXmlDevInfDataStoreAssembleRxTx(SmlXmlAssembler *assm, const char *element, const char *cttype, const char *version, SmlError **error) 
    16731673{ 
    1674         smlTrace(TRACE_ENTRY, "%s(%p, %s, %s, %s, %p)", __func__, assm, element, cttype, version, error); 
     1674        smlTrace(TRACE_ENTRY, "%s(%p, %s, %s, %s, %p)", __func__, assm, element?element:"NULL", cttype?cttype:"NULL", version?version:"NULL", error); 
    16751675        smlAssert(assm); 
    16761676        smlAssert(element); 
    16771677        smlAssert(cttype); 
     
    16921692        return TRUE; 
    16931693         
    16941694error: 
    1695         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1695        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    16961696        return FALSE; 
    16971697} 
    16981698 
     
    18371837        return TRUE; 
    18381838         
    18391839error: 
    1840         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1840        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    18411841        return FALSE; 
    18421842} 
    18431843 
     
    19791979         
    19801980        g_free(assm); 
    19811981         
    1982         smlTrace(TRACE_INTERNAL, "Message Assembled: %s", *data); 
     1982        smlTrace(TRACE_INTERNAL, "Message Assembled: %s", *data?*data:"NULL"); 
    19831983         
    19841984        smlTrace(TRACE_EXIT, "%s", __func__); 
    19851985        return TRUE; 
     
    19921992error_free_assm: 
    19931993        g_free(assm); 
    19941994error: 
    1995         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1995        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    19961996        return FALSE; 
    19971997} 
    19981998 
  • ./libsyncml/parser/sml_xml_parse.c

    old new  
    277277         
    278278        if (*version) { 
    279279                smlErrorSet(error, SML_ERROR_GENERIC, "dtd already set"); 
    280                 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     280                smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    281281                return FALSE; 
    282282        } 
    283283         
     
    303303 
    304304error: 
    305305        *version = SML_VERSION_UNKNOWN; 
    306         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     306        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    307307        return FALSE; 
    308308} 
    309309 
     
    315315         
    316316        if (*type) { 
    317317                smlErrorSet(error, SML_ERROR_GENERIC, "protocol already set"); 
    318                 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     318                smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    319319                return FALSE; 
    320320        } 
    321321         
     
    337337 
    338338error: 
    339339        *type = SML_PROTOCOL_UNKNOWN; 
    340         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     340        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    341341        return FALSE; 
    342342} 
    343343 
     
    350350         
    351351        if (*location) { 
    352352                smlErrorSet(error, SML_ERROR_GENERIC, "Location already set"); 
    353                 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     353                smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    354354                return FALSE; 
    355355        } 
    356356         
     
    400400        smlLocationUnref(*location); 
    401401error: 
    402402        *location = NULL; 
    403         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     403        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    404404        return FALSE; 
    405405} 
    406406 
     
    412412         
    413413        if (*anchor) { 
    414414                smlErrorSet(error, SML_ERROR_GENERIC, "anchor already set"); 
    415                 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     415                smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    416416                return FALSE; 
    417417        } 
    418418         
     
    458458        smlAnchorFree(*anchor); 
    459459error: 
    460460        *anchor = NULL; 
    461         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     461        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    462462        return FALSE; 
    463463} 
    464464 
     
    507507        if (type) 
    508508                *type = NULL; 
    509509 
    510         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     510        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    511511        return FALSE; 
    512512} 
    513513 
     
    586586                *anchor = NULL; 
    587587        if (type) 
    588588                *type = NULL; 
    589         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     589        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    590590        return FALSE; 
    591591} 
    592592 
     
    729729error_free_item: 
    730730        smlItemUnref(item); 
    731731error: 
    732         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     732        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    733733        return NULL; 
    734734} 
    735735 
     
    806806                g_free(format); 
    807807        if (type) 
    808808                g_free(type); 
    809         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     809        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    810810        return NULL; 
    811811} 
    812812 
     
    875875                g_free(format); 
    876876        if (type) 
    877877                g_free(type); 
    878         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     878        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    879879        return NULL; 
    880880} 
    881881 
    882882static SmlBool _smlChangeParse(SmlXmlParser *parser, SmlCommand **cmd, SmlCommandType type, const char *name, SmlError **error) 
    883883{ 
    884         smlTrace(TRACE_ENTRY, "%s(%p, %i, %s, %p)", __func__, parser, type, name, error); 
     884        smlTrace(TRACE_ENTRY, "%s(%p, %i, %s, %p)", __func__, parser, type, name?name:"NULL", error); 
    885885        smlAssert(parser); 
    886886        smlAssert(name); 
    887887        char *contenttype = NULL; 
     
    984984        if (contenttype) 
    985985                g_free(contenttype); 
    986986        *cmd = NULL; 
    987         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     987        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    988988        return FALSE; 
    989989} 
    990990 
     
    10371037error: 
    10381038        *maxmsgsize = 0; 
    10391039        *maxobjsize = 0; 
    1040         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1040        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    10411041        return FALSE; 
    10421042} 
    10431043 
     
    11081108        smlCommandUnref(*cmd); 
    11091109error: 
    11101110        *cmd = NULL; 
    1111         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1111        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    11121112        return FALSE; 
    11131113} 
    11141114 
     
    11741174        smlCommandUnref(*cmd); 
    11751175error: 
    11761176        *cmd = NULL; 
    1177         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1177        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    11781178        return FALSE; 
    11791179} 
    11801180 
     
    12201220error_free_item: 
    12211221        smlMapItemUnref(item); 
    12221222error: 
    1223         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1223        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    12241224        return NULL; 
    12251225} 
    12261226 
     
    12821282        smlCommandUnref(*cmd); 
    12831283error: 
    12841284        *cmd = NULL; 
    1285         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1285        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    12861286        return FALSE; 
    12871287} 
    12881288 
     
    13661366        *cmd = NULL; 
    13671367        if (contenttype) 
    13681368                g_free(contenttype); 
    1369         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1369        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    13701370        return FALSE; 
    13711371} 
    13721372 
     
    14861486        *cmd = NULL; 
    14871487        if (contenttype) 
    14881488                g_free(contenttype); 
    1489         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1489        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    14901490        return FALSE; 
    14911491} 
    14921492 
     
    15041504         
    15051505        //Fixme debug if 
    15061506        char *debugstr = smlPrintBinary(data, size); 
    1507         smlTrace(TRACE_INTERNAL, "Xml input: %s", debugstr); 
     1507        smlTrace(TRACE_INTERNAL, "Xml input: %s", debugstr?debugstr:"NULL"); 
    15081508        smlLog("received-%i.xml", data, size); 
    15091509        g_free(debugstr); 
    15101510         
     
    15331533        xmlFreeTextReader(parser->reader); 
    15341534error: 
    15351535        parser->reader = NULL; 
    1536         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1536        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    15371537        return FALSE; 
    15381538} 
    15391539 
     
    15901590        return TRUE; 
    15911591 
    15921592error: 
    1593         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1593        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    15941594        return FALSE; 
    15951595} 
    15961596 
     
    17261726        if (*cred) 
    17271727                smlCredFree(*cred); 
    17281728error: 
    1729         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1729        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    17301730        return FALSE; 
    17311731} 
    17321732 
     
    18671867                goto error_free_status; 
    18681868        } 
    18691869         
    1870         smlTrace(TRACE_INTERNAL, "Got status %p with: cmdRef %i, msgRef %i, type %i, data %s", *status, (*status)->cmdRef, (*status)->msgRef, (*status)->type, (*status)->data); 
     1870        smlTrace(TRACE_INTERNAL, "Got status %p with: cmdRef %i, msgRef %i, type %i, data %s", *status, (*status)->cmdRef, (*status)->msgRef, (*status)->type, (*status)->data?(*status)->data:"NULL"); 
    18711871         
    18721872        smlTrace(TRACE_EXIT, "%s", __func__); 
    18731873        return TRUE; 
     
    18761876        smlStatusUnref(*status); 
    18771877error: 
    18781878        *status = NULL; 
    1879         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1879        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    18801880        return FALSE; 
    18811881} 
    18821882 
     
    19791979        smlCommandUnref(*cmd); 
    19801980error: 
    19811981        *cmd = NULL; 
    1982         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     1982        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    19831983        return SML_PARSER_RESULT_ERROR; 
    19841984} 
    19851985 
     
    20032003        return parser; 
    20042004 
    20052005error: 
    2006         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     2006        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    20072007        return NULL; 
    20082008} 
    20092009 
     
    20582058        return TRUE; 
    20592059         
    20602060error: 
    2061         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     2061        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    20622062        return FALSE; 
    20632063} 
    20642064 
     
    20992099        return TRUE; 
    21002100         
    21012101error: 
    2102         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     2102        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    21032103        return FALSE; 
    21042104} 
    21052105 
    21062106static SmlBool _smlXmlDevInfDataStoreParseRxTx(SmlXmlParser *parser, const char *element, char **cttype, char **version, SmlError **error) 
    21072107{ 
    2108         smlTrace(TRACE_ENTRY, "%s(%p, %s, %p, %p, %p)", __func__, parser, element, cttype, version, error); 
     2108        smlTrace(TRACE_ENTRY, "%s(%p, %s, %p, %p, %p)", __func__, parser, element?element:"NULL", cttype, version, error); 
    21092109        smlAssert(parser); 
    21102110        smlAssert(element); 
    21112111        smlAssert(cttype); 
     
    21622162        return TRUE; 
    21632163         
    21642164error: 
    2165         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     2165        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    21662166        return FALSE; 
    21672167} 
    21682168 
     
    22382238error_free_datastore: 
    22392239        smlDevInfDataStoreUnref(datastore); 
    22402240error: 
    2241         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     2241        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    22422242        return FALSE; 
    22432243} 
    22442244 
     
    22502250         
    22512251        //Fixme debug if 
    22522252        char *debugstr = smlPrintBinary(data, size); 
    2253         smlTrace(TRACE_INTERNAL, "Xml devinf input: %s", debugstr); 
     2253        smlTrace(TRACE_INTERNAL, "Xml devinf input: %s", debugstr?debugstr:"NULL"); 
    22542254        g_free(debugstr); 
    22552255         
    22562256        SmlXmlParser *parser = smlTryMalloc0(sizeof(SmlXmlParser), error); 
     
    24412441        parser->reader = NULL; 
    24422442        g_free(parser); 
    24432443error: 
    2444         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     2444        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    24452445        return FALSE; 
    24462446} 
    24472447 
  • ./libsyncml/objects/sml_auth.c

    old new  
    6868                smlTrace(TRACE_INTERNAL, "Auth is already accepted %i", auth->enabled); 
    6969                auth->state = SML_AUTH_ACCEPTED; 
    7070        } else { 
    71                 smlTrace(TRACE_INTERNAL, "Input is \"%s\"", cred->data); 
     71                smlTrace(TRACE_INTERNAL, "Input is \"%s\"", cred->data?cred->data:"NULL"); 
    7272                 
    7373                switch (cred->type) { 
    7474                        case SML_AUTH_TYPE_BASIC: 
     
    7676                                if (!smlBase64Decode(cred->data, &buffer, &buffersize, &error)) 
    7777                                        goto error; 
    7878                                 
    79                                 smlTrace(TRACE_INTERNAL, "After decode is \"%s\"", buffer); 
     79                                smlTrace(TRACE_INTERNAL, "After decode is \"%s\"", buffer?buffer:"NULL"); 
    8080                                 
    8181                                char **arr = g_strsplit(buffer, ":", 2); 
    8282                                g_free(buffer); 
    8383                                 
    84                                 smlTrace(TRACE_INTERNAL, "Username \"%s\", Password \"%s\"", arr[0], arr[1]); 
     84                                smlTrace(TRACE_INTERNAL, "Username \"%s\", Password \"%s\"", arr[0]?arr[0]:"NULL", arr[1]?arr[1]:"NULL"); 
    8585                                 
    8686                                if (auth->verifyCallback) { 
    8787                                        auth->verifyCallback(auth, arr[0], arr[1], auth->verifyCallbackUserdata, &auth->state); 
     
    128128 
    129129error: 
    130130        smlSessionDispatchEvent(session, SML_SESSION_EVENT_ERROR, NULL, NULL, NULL, error); 
    131         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(&error)); 
     131        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(&error)?smlErrorPrint(&error):"NULL"); 
    132132        smlErrorDeref(&error); 
    133133        return; 
    134134} 
     
    157157        return auth; 
    158158 
    159159error: 
    160         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     160        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    161161        return NULL; 
    162162} 
    163163 
     
    217217error_free_reply: 
    218218        smlStatusUnref(reply); 
    219219error: 
    220         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     220        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    221221        return NULL; 
    222222} 
    223223 
  • ./libsyncml/sml_elements.c

    old new  
    4545 
    4646SmlLocation *smlLocationNew(const char *locURI, const char *locName, SmlError **error) 
    4747{ 
    48         smlTrace(TRACE_ENTRY, "%s(%s, %s, %p)", __func__, locURI, locName, error); 
     48        smlTrace(TRACE_ENTRY, "%s(%s, %s, %p)", __func__, locURI?locURI:"NULL", locName?locName:"NULL", error); 
    4949         
    5050        if (!locURI) { 
    5151                smlErrorSet(error, SML_ERROR_GENERIC, "No locURI was given"); 
  • ./libsyncml/sml_command.c

    old new  
    460460 
    461461SmlCommand *smlCommandNewAlert(SmlAlertType type, SmlLocation *target, SmlLocation *source, const char *next, const char *last, const char *contenttype, SmlError **error) 
    462462{ 
    463         smlTrace(TRACE_ENTRY, "%s(%i, %p, %p, %s, %s, %s, %p)", __func__, type, target, source, next, last, contenttype, error); 
     463        smlTrace(TRACE_ENTRY, "%s(%i, %p, %p, %s, %s, %s, %p)", __func__, type, target, source, next?next:"NULL", last?last:"NULL", contenttype?contenttype:"NULL", error); 
    464464         
    465465        SmlCommand *cmd = smlCommandNew(SML_COMMAND_TYPE_ALERT, error); 
    466466        if (!cmd) 
  • ./libsyncml/sml_support.c

    old new  
    325325        return thread; 
    326326         
    327327error: 
    328         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     328        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    329329        return NULL; 
    330330} 
    331331 
  • ./libsyncml/sml_base64.c

    old new  
    9191                return TRUE; 
    9292        } 
    9393         
    94         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     94        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    9595        return FALSE; 
    9696} 
    9797 
     
    157157error: 
    158158        *output = NULL; 
    159159        *outsize = 0; 
    160         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     160        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    161161        return FALSE; 
    162162} 
    163163 
     
    179179                return TRUE; 
    180180        } 
    181181         
    182         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     182        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    183183        return FALSE; 
    184184} 
    185185  
     
    229229        return TRUE; 
    230230 
    231231error: 
    232         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     232        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    233233        return FALSE; 
    234234} 
    235235 
  • ./libsyncml/sml_notification.c

    old new  
    5252 
    5353SmlNotification *smlNotificationNew(SmlNotificationVersion version, SmlNotificationUIMode mode, SmlNotificationInitiator init, unsigned int sessionID, const char *identifier, const char *target, SmlMimeType type, SmlError **error) 
    5454{ 
    55         smlTrace(TRACE_ENTRY, "%s(%i, %i, %i, %i, %s, %s, %i, %p)", __func__, version, mode, init, sessionID, identifier, target, type, error); 
     55        smlTrace(TRACE_ENTRY, "%s(%i, %i, %i, %i, %s, %s, %i, %p)", __func__, version, mode, init, sessionID, identifier?identifier:"NULL", target?target:"NULL", type, error); 
    5656 
    5757        SmlNotification *san = smlTryMalloc0(sizeof(SmlNotification), error); 
    5858        if (!san) 
     
    7575error_free_san: 
    7676 
    7777error: 
    78         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     78        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    7979        return NULL; 
    8080} 
    8181 
     
    118118        return TRUE; 
    119119 
    120120error: 
    121         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     121        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    122122        return FALSE; 
    123123} 
    124124 
     
    264264        g_free(san->identifier); 
    265265        g_free(san); 
    266266error: 
    267         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     267        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    268268        return NULL; 
    269269} 
    270270 
     
    355355error: 
    356356        *data = NULL; 
    357357        *size = 0; 
    358         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     358        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    359359        return FALSE; 
    360360} 
    361361 
     
    446446error: 
    447447        *data = NULL; 
    448448        *size = 0; 
    449         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     449        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    450450        return FALSE; 
    451451} 
    452452 
     
    501501error_free_data: 
    502502        g_free(data); 
    503503error: 
    504         smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)); 
     504        smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 
    505505        return FALSE; 
    506506} 
    507507 
  • ./libsyncml/sml_queue.c

    old new  
    247247        for (m = queue->head; m; m = m->next) { 
    248248                g_string_append_printf(info, ", %p (list %p)", m->data, m); 
    249249        } 
    250         smlTrace(TRACE_INTERNAL, "%s", info->str); 
     250        smlTrace(TRACE_INTERNAL, "%s", info->str?info->str:"NULL"); 
    251251        g_string_free(info, TRUE); 
    252252         
    253253        info = g_string_new("Contents of prio queue:"); 
    254254        for (m = queue->prio; m; m = m->next) { 
    255255                g_string_append_printf(info, ", %p (list %p)", m->data, m); 
    256256        } 
    257         smlTrace(TRACE_INTERNAL, "%s", info->str); 
     257        smlTrace(TRACE_INTERNAL, "%s", info->str?info->str:"NULL"); 
    258258        g_string_free(info, TRUE); 
    259259        smlTrace(TRACE_INTERNAL, "Tail of queue: %p (list %p)", queue->tail ? queue->tail->data : NULL, queue->tail); 
    260260