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 41 41 42 42 static SmlBool _smlXmlAssemblerStartNodeNS(SmlXmlAssembler *assm, const char *name, const char *uri, SmlError **error) 43 43 { 44 smlTrace(TRACE_INTERNAL, "%s: Starting \"%s\"", __func__, name );44 smlTrace(TRACE_INTERNAL, "%s: Starting \"%s\"", __func__, name?name:"NULL"); 45 45 int rc = xmlTextWriterStartElementNS(assm->writer, NULL, (xmlChar *)name, (xmlChar *)uri); 46 46 if (rc < 0) { 47 47 smlErrorSet(error, SML_ERROR_GENERIC, "Unable to start node"); … … 124 124 125 125 SmlBool smlLocationAssemble(SmlLocation *location, SmlXmlAssembler *assm, const char *name, SmlError **error) 126 126 { 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); 128 128 smlAssert(assm); 129 129 smlAssert(location); 130 130 … … 155 155 return TRUE; 156 156 157 157 error: 158 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );158 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 159 159 return FALSE; 160 160 } 161 161 … … 193 193 return TRUE; 194 194 195 195 error: 196 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );196 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 197 197 return FALSE; 198 198 } 199 199 … … 250 250 return TRUE; 251 251 252 252 error: 253 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );253 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 254 254 return FALSE; 255 255 } 256 256 … … 302 302 return TRUE; 303 303 304 304 error: 305 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );305 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 306 306 return FALSE; 307 307 } 308 308 … … 340 340 return TRUE; 341 341 342 342 error: 343 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );343 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 344 344 return FALSE; 345 345 } 346 346 … … 401 401 return TRUE; 402 402 403 403 error: 404 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );404 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 405 405 return FALSE; 406 406 } 407 407 … … 460 460 return TRUE; 461 461 462 462 error: 463 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );463 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 464 464 return FALSE; 465 465 } 466 466 … … 491 491 return TRUE; 492 492 493 493 error: 494 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );494 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 495 495 return FALSE; 496 496 } 497 497 … … 528 528 return TRUE; 529 529 530 530 error: 531 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );531 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 532 532 return FALSE; 533 533 } 534 534 … … 589 589 return TRUE; 590 590 591 591 error: 592 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );592 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 593 593 return FALSE; 594 594 } 595 595 … … 632 632 return TRUE; 633 633 634 634 error: 635 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );635 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 636 636 return FALSE; 637 637 } 638 638 … … 765 765 xmlBufferFree(assm->header_buffer); 766 766 assm->header_buffer = NULL; 767 767 error: 768 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );768 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 769 769 return FALSE; 770 770 } 771 771 … … 959 959 return TRUE; 960 960 961 961 error: 962 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );962 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 963 963 return FALSE; 964 964 } 965 965 … … 994 994 return TRUE; 995 995 996 996 error: 997 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );997 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 998 998 return FALSE; 999 999 } 1000 1000 … … 1022 1022 return TRUE; 1023 1023 1024 1024 error: 1025 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1025 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1026 1026 return FALSE; 1027 1027 } 1028 1028 … … 1204 1204 error_free_buffer: 1205 1205 xmlBufferFree(res->buffer); 1206 1206 error: 1207 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1207 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1208 1208 return FALSE; 1209 1209 } 1210 1210 … … 1332 1332 return TRUE; 1333 1333 1334 1334 error: 1335 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1335 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1336 1336 return FALSE; 1337 1337 } 1338 1338 … … 1358 1358 if (!cmdname) 1359 1359 goto error; 1360 1360 } 1361 smlTrace(TRACE_INTERNAL, "opening node %s", cmdname );1361 smlTrace(TRACE_INTERNAL, "opening node %s", cmdname?cmdname:"NULL"); 1362 1362 1363 1363 if (!_smlXmlAssemblerStartNode(assm, cmdname, error)) 1364 1364 goto error; … … 1385 1385 return TRUE; 1386 1386 1387 1387 error: 1388 smlTrace(TRACE_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1388 smlTrace(TRACE_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1389 1389 return FALSE; 1390 1390 } 1391 1391 … … 1537 1537 1538 1538 //FIXME ADD debug ifs 1539 1539 char *debugstr = smlPrintBinary(*data, *size); 1540 smlTrace(TRACE_INTERNAL, "Message Assembled: %s", debugstr );1540 smlTrace(TRACE_INTERNAL, "Message Assembled: %s", debugstr?debugstr:"NULL"); 1541 1541 g_free(debugstr); 1542 1542 1543 1543 smlTrace(TRACE_EXIT, "%s", __func__); … … 1549 1549 error_free_buffer: 1550 1550 xmlBufferFree(buffer); 1551 1551 error: 1552 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1552 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1553 1553 return FALSE; 1554 1554 } 1555 1555 … … 1665 1665 return assm; 1666 1666 1667 1667 error: 1668 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1668 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1669 1669 return NULL; 1670 1670 } 1671 1671 1672 1672 static SmlBool _smlXmlDevInfDataStoreAssembleRxTx(SmlXmlAssembler *assm, const char *element, const char *cttype, const char *version, SmlError **error) 1673 1673 { 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); 1675 1675 smlAssert(assm); 1676 1676 smlAssert(element); 1677 1677 smlAssert(cttype); … … 1692 1692 return TRUE; 1693 1693 1694 1694 error: 1695 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1695 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1696 1696 return FALSE; 1697 1697 } 1698 1698 … … 1837 1837 return TRUE; 1838 1838 1839 1839 error: 1840 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1840 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1841 1841 return FALSE; 1842 1842 } 1843 1843 … … 1979 1979 1980 1980 g_free(assm); 1981 1981 1982 smlTrace(TRACE_INTERNAL, "Message Assembled: %s", *data );1982 smlTrace(TRACE_INTERNAL, "Message Assembled: %s", *data?*data:"NULL"); 1983 1983 1984 1984 smlTrace(TRACE_EXIT, "%s", __func__); 1985 1985 return TRUE; … … 1992 1992 error_free_assm: 1993 1993 g_free(assm); 1994 1994 error: 1995 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1995 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1996 1996 return FALSE; 1997 1997 } 1998 1998 -
./libsyncml/parser/sml_xml_parse.c
old new 277 277 278 278 if (*version) { 279 279 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"); 281 281 return FALSE; 282 282 } 283 283 … … 303 303 304 304 error: 305 305 *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"); 307 307 return FALSE; 308 308 } 309 309 … … 315 315 316 316 if (*type) { 317 317 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"); 319 319 return FALSE; 320 320 } 321 321 … … 337 337 338 338 error: 339 339 *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"); 341 341 return FALSE; 342 342 } 343 343 … … 350 350 351 351 if (*location) { 352 352 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"); 354 354 return FALSE; 355 355 } 356 356 … … 400 400 smlLocationUnref(*location); 401 401 error: 402 402 *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"); 404 404 return FALSE; 405 405 } 406 406 … … 412 412 413 413 if (*anchor) { 414 414 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"); 416 416 return FALSE; 417 417 } 418 418 … … 458 458 smlAnchorFree(*anchor); 459 459 error: 460 460 *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"); 462 462 return FALSE; 463 463 } 464 464 … … 507 507 if (type) 508 508 *type = NULL; 509 509 510 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );510 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 511 511 return FALSE; 512 512 } 513 513 … … 586 586 *anchor = NULL; 587 587 if (type) 588 588 *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"); 590 590 return FALSE; 591 591 } 592 592 … … 729 729 error_free_item: 730 730 smlItemUnref(item); 731 731 error: 732 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );732 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 733 733 return NULL; 734 734 } 735 735 … … 806 806 g_free(format); 807 807 if (type) 808 808 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"); 810 810 return NULL; 811 811 } 812 812 … … 875 875 g_free(format); 876 876 if (type) 877 877 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"); 879 879 return NULL; 880 880 } 881 881 882 882 static SmlBool _smlChangeParse(SmlXmlParser *parser, SmlCommand **cmd, SmlCommandType type, const char *name, SmlError **error) 883 883 { 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); 885 885 smlAssert(parser); 886 886 smlAssert(name); 887 887 char *contenttype = NULL; … … 984 984 if (contenttype) 985 985 g_free(contenttype); 986 986 *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"); 988 988 return FALSE; 989 989 } 990 990 … … 1037 1037 error: 1038 1038 *maxmsgsize = 0; 1039 1039 *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"); 1041 1041 return FALSE; 1042 1042 } 1043 1043 … … 1108 1108 smlCommandUnref(*cmd); 1109 1109 error: 1110 1110 *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"); 1112 1112 return FALSE; 1113 1113 } 1114 1114 … … 1174 1174 smlCommandUnref(*cmd); 1175 1175 error: 1176 1176 *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"); 1178 1178 return FALSE; 1179 1179 } 1180 1180 … … 1220 1220 error_free_item: 1221 1221 smlMapItemUnref(item); 1222 1222 error: 1223 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1223 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1224 1224 return NULL; 1225 1225 } 1226 1226 … … 1282 1282 smlCommandUnref(*cmd); 1283 1283 error: 1284 1284 *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"); 1286 1286 return FALSE; 1287 1287 } 1288 1288 … … 1366 1366 *cmd = NULL; 1367 1367 if (contenttype) 1368 1368 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"); 1370 1370 return FALSE; 1371 1371 } 1372 1372 … … 1486 1486 *cmd = NULL; 1487 1487 if (contenttype) 1488 1488 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"); 1490 1490 return FALSE; 1491 1491 } 1492 1492 … … 1504 1504 1505 1505 //Fixme debug if 1506 1506 char *debugstr = smlPrintBinary(data, size); 1507 smlTrace(TRACE_INTERNAL, "Xml input: %s", debugstr );1507 smlTrace(TRACE_INTERNAL, "Xml input: %s", debugstr?debugstr:"NULL"); 1508 1508 smlLog("received-%i.xml", data, size); 1509 1509 g_free(debugstr); 1510 1510 … … 1533 1533 xmlFreeTextReader(parser->reader); 1534 1534 error: 1535 1535 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"); 1537 1537 return FALSE; 1538 1538 } 1539 1539 … … 1590 1590 return TRUE; 1591 1591 1592 1592 error: 1593 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1593 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1594 1594 return FALSE; 1595 1595 } 1596 1596 … … 1726 1726 if (*cred) 1727 1727 smlCredFree(*cred); 1728 1728 error: 1729 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );1729 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 1730 1730 return FALSE; 1731 1731 } 1732 1732 … … 1867 1867 goto error_free_status; 1868 1868 } 1869 1869 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"); 1871 1871 1872 1872 smlTrace(TRACE_EXIT, "%s", __func__); 1873 1873 return TRUE; … … 1876 1876 smlStatusUnref(*status); 1877 1877 error: 1878 1878 *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"); 1880 1880 return FALSE; 1881 1881 } 1882 1882 … … 1979 1979 smlCommandUnref(*cmd); 1980 1980 error: 1981 1981 *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"); 1983 1983 return SML_PARSER_RESULT_ERROR; 1984 1984 } 1985 1985 … … 2003 2003 return parser; 2004 2004 2005 2005 error: 2006 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );2006 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 2007 2007 return NULL; 2008 2008 } 2009 2009 … … 2058 2058 return TRUE; 2059 2059 2060 2060 error: 2061 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );2061 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 2062 2062 return FALSE; 2063 2063 } 2064 2064 … … 2099 2099 return TRUE; 2100 2100 2101 2101 error: 2102 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );2102 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 2103 2103 return FALSE; 2104 2104 } 2105 2105 2106 2106 static SmlBool _smlXmlDevInfDataStoreParseRxTx(SmlXmlParser *parser, const char *element, char **cttype, char **version, SmlError **error) 2107 2107 { 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); 2109 2109 smlAssert(parser); 2110 2110 smlAssert(element); 2111 2111 smlAssert(cttype); … … 2162 2162 return TRUE; 2163 2163 2164 2164 error: 2165 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );2165 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 2166 2166 return FALSE; 2167 2167 } 2168 2168 … … 2238 2238 error_free_datastore: 2239 2239 smlDevInfDataStoreUnref(datastore); 2240 2240 error: 2241 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );2241 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 2242 2242 return FALSE; 2243 2243 } 2244 2244 … … 2250 2250 2251 2251 //Fixme debug if 2252 2252 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"); 2254 2254 g_free(debugstr); 2255 2255 2256 2256 SmlXmlParser *parser = smlTryMalloc0(sizeof(SmlXmlParser), error); … … 2441 2441 parser->reader = NULL; 2442 2442 g_free(parser); 2443 2443 error: 2444 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );2444 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 2445 2445 return FALSE; 2446 2446 } 2447 2447 -
./libsyncml/objects/sml_auth.c
old new 68 68 smlTrace(TRACE_INTERNAL, "Auth is already accepted %i", auth->enabled); 69 69 auth->state = SML_AUTH_ACCEPTED; 70 70 } else { 71 smlTrace(TRACE_INTERNAL, "Input is \"%s\"", cred->data );71 smlTrace(TRACE_INTERNAL, "Input is \"%s\"", cred->data?cred->data:"NULL"); 72 72 73 73 switch (cred->type) { 74 74 case SML_AUTH_TYPE_BASIC: … … 76 76 if (!smlBase64Decode(cred->data, &buffer, &buffersize, &error)) 77 77 goto error; 78 78 79 smlTrace(TRACE_INTERNAL, "After decode is \"%s\"", buffer );79 smlTrace(TRACE_INTERNAL, "After decode is \"%s\"", buffer?buffer:"NULL"); 80 80 81 81 char **arr = g_strsplit(buffer, ":", 2); 82 82 g_free(buffer); 83 83 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"); 85 85 86 86 if (auth->verifyCallback) { 87 87 auth->verifyCallback(auth, arr[0], arr[1], auth->verifyCallbackUserdata, &auth->state); … … 128 128 129 129 error: 130 130 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"); 132 132 smlErrorDeref(&error); 133 133 return; 134 134 } … … 157 157 return auth; 158 158 159 159 error: 160 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );160 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 161 161 return NULL; 162 162 } 163 163 … … 217 217 error_free_reply: 218 218 smlStatusUnref(reply); 219 219 error: 220 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );220 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 221 221 return NULL; 222 222 } 223 223 -
./libsyncml/sml_elements.c
old new 45 45 46 46 SmlLocation *smlLocationNew(const char *locURI, const char *locName, SmlError **error) 47 47 { 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); 49 49 50 50 if (!locURI) { 51 51 smlErrorSet(error, SML_ERROR_GENERIC, "No locURI was given"); -
./libsyncml/sml_command.c
old new 460 460 461 461 SmlCommand *smlCommandNewAlert(SmlAlertType type, SmlLocation *target, SmlLocation *source, const char *next, const char *last, const char *contenttype, SmlError **error) 462 462 { 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); 464 464 465 465 SmlCommand *cmd = smlCommandNew(SML_COMMAND_TYPE_ALERT, error); 466 466 if (!cmd) -
./libsyncml/sml_support.c
old new 325 325 return thread; 326 326 327 327 error: 328 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );328 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 329 329 return NULL; 330 330 } 331 331 -
./libsyncml/sml_base64.c
old new 91 91 return TRUE; 92 92 } 93 93 94 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );94 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 95 95 return FALSE; 96 96 } 97 97 … … 157 157 error: 158 158 *output = NULL; 159 159 *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"); 161 161 return FALSE; 162 162 } 163 163 … … 179 179 return TRUE; 180 180 } 181 181 182 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );182 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 183 183 return FALSE; 184 184 } 185 185 … … 229 229 return TRUE; 230 230 231 231 error: 232 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );232 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 233 233 return FALSE; 234 234 } 235 235 -
./libsyncml/sml_notification.c
old new 52 52 53 53 SmlNotification *smlNotificationNew(SmlNotificationVersion version, SmlNotificationUIMode mode, SmlNotificationInitiator init, unsigned int sessionID, const char *identifier, const char *target, SmlMimeType type, SmlError **error) 54 54 { 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); 56 56 57 57 SmlNotification *san = smlTryMalloc0(sizeof(SmlNotification), error); 58 58 if (!san) … … 75 75 error_free_san: 76 76 77 77 error: 78 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );78 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 79 79 return NULL; 80 80 } 81 81 … … 118 118 return TRUE; 119 119 120 120 error: 121 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );121 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 122 122 return FALSE; 123 123 } 124 124 … … 264 264 g_free(san->identifier); 265 265 g_free(san); 266 266 error: 267 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );267 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 268 268 return NULL; 269 269 } 270 270 … … 355 355 error: 356 356 *data = NULL; 357 357 *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"); 359 359 return FALSE; 360 360 } 361 361 … … 446 446 error: 447 447 *data = NULL; 448 448 *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"); 450 450 return FALSE; 451 451 } 452 452 … … 501 501 error_free_data: 502 502 g_free(data); 503 503 error: 504 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error) );504 smlTrace(TRACE_EXIT_ERROR, "%s: %s", __func__, smlErrorPrint(error)?smlErrorPrint(error):"NULL"); 505 505 return FALSE; 506 506 } 507 507 -
./libsyncml/sml_queue.c
old new 247 247 for (m = queue->head; m; m = m->next) { 248 248 g_string_append_printf(info, ", %p (list %p)", m->data, m); 249 249 } 250 smlTrace(TRACE_INTERNAL, "%s", info->str );250 smlTrace(TRACE_INTERNAL, "%s", info->str?info->str:"NULL"); 251 251 g_string_free(info, TRUE); 252 252 253 253 info = g_string_new("Contents of prio queue:"); 254 254 for (m = queue->prio; m; m = m->next) { 255 255 g_string_append_printf(info, ", %p (list %p)", m->data, m); 256 256 } 257 smlTrace(TRACE_INTERNAL, "%s", info->str );257 smlTrace(TRACE_INTERNAL, "%s", info->str?info->str:"NULL"); 258 258 g_string_free(info, TRUE); 259 259 smlTrace(TRACE_INTERNAL, "Tail of queue: %p (list %p)", queue->tail ? queue->tail->data : NULL, queue->tail); 260 260
