Changeset 2437
- Timestamp:
- 08/11/07 07:01:23 (1 year ago)
- Files:
-
- plugins/palm/src/Makefile.am (modified) (1 diff)
- plugins/palm/src/palm_contact.c (modified) (5 diffs)
- plugins/palm/src/palm_event.c (modified) (5 diffs)
- plugins/palm/src/palm_format.c (modified) (38 diffs)
- plugins/palm/src/palm_note.c (modified) (6 diffs)
- plugins/palm/src/palm_sync.c (modified) (17 diffs)
- plugins/palm/src/palm_todo.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/palm/src/Makefile.am
r1266 r2437 4 4 opensyncheaderdir=@OPENSYNC_HEADERDIR@ 5 5 6 AM_CFLAGS = @PILOT_CFLAGS@ @PACKAGE_CFLAGS@ -Wall -Werror6 AM_CFLAGS = @PILOT_CFLAGS@ @PACKAGE_CFLAGS@ 7 7 8 8 EXTRA_DIST = \ plugins/palm/src/palm_contact.c
r2333 r2437 84 84 osync_change_unref(change); 85 85 error: 86 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );86 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 87 87 return NULL; 88 88 } … … 144 144 psyncDBClose(db); 145 145 error: 146 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) );146 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) ? osync_error_print(&error) : "nil"); 147 147 osync_context_report_osyncerror(ctx, error); 148 148 osync_error_unref(&error); … … 236 236 GList *c = NULL; 237 237 for (c = contact->categories; c; c = c->next) { 238 osync_trace(TRACE_INTERNAL, "searching category %s\n", c->data );238 osync_trace(TRACE_INTERNAL, "searching category %s\n", c->data ? c->data : "nil"); 239 239 entry->category = psyncDBCategoryToId(db, c->data, NULL); 240 240 if (entry->category != 0) { … … 281 281 error: 282 282 osync_context_report_osyncerror(ctx, error); 283 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) );283 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) ? osync_error_print(&error) : "nil"); 284 284 osync_error_unref(&error); 285 285 } … … 300 300 } else { 301 301 osync_context_report_osyncerror(ctx, error); 302 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) );302 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) ? osync_error_print(&error) : "nil"); 303 303 osync_error_unref(&error); 304 304 return; plugins/palm/src/palm_event.c
r1222 r2437 60 60 const char *catname = psyncDBCategoryFromId(entry->db, entry->category, NULL); 61 61 if (catname) { 62 osync_trace(TRACE_INTERNAL, "CATNAME: %s", catname );62 osync_trace(TRACE_INTERNAL, "CATNAME: %s", catname ? catname : "nil"); 63 63 event->categories = g_list_append(event->categories, g_strdup(catname)); 64 64 } else { … … 81 81 osync_change_free(change); 82 82 error: 83 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );83 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 84 84 return NULL; 85 85 } … … 145 145 psyncDBClose(db); 146 146 error: 147 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );147 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 148 148 return FALSE; 149 149 } … … 204 204 GList *c = NULL; 205 205 for (c = event->categories; c; c = c->next) { 206 osync_trace(TRACE_INTERNAL, "searching category %s\n", c->data );206 osync_trace(TRACE_INTERNAL, "searching category %s\n", c->data ? c->data : "nil"); 207 207 entry->category = psyncDBCategoryToId(db, c->data, NULL); 208 208 if (entry->category != 0) { … … 254 254 error: 255 255 osync_context_report_osyncerror(ctx, &error); 256 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) );256 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) ? osync_error_print(&error) : "nil"); 257 257 return FALSE; 258 258 } plugins/palm/src/palm_format.c
r2388 r2437 32 32 ret = g_convert(text, strlen(text), "utf8", "cp1252", NULL, NULL, NULL); 33 33 34 osync_trace(TRACE_SENSITIVE, "%s(): %s -> %s", __func__, text , ret);34 osync_trace(TRACE_SENSITIVE, "%s(): %s -> %s", __func__, text ? text : "nil", ret ? ret : "nil"); 35 35 36 36 return ret; … … 42 42 ret = g_convert(text, strlen(text), "cp1252", "utf8", NULL, NULL, NULL); 43 43 44 osync_trace(TRACE_SENSITIVE, "%s(): %s -> %s", __func__, text , ret);44 osync_trace(TRACE_SENSITIVE, "%s(): %s -> %s", __func__, text ? text : "nil", ret ? ret: "nil"); 45 45 46 46 return ret; … … 61 61 } 62 62 63 osync_trace(TRACE_SENSITIVE, "codepage: %s\n", entry->codepage );63 osync_trace(TRACE_SENSITIVE, "codepage: %s\n", entry->codepage ? entry->codepage : "nil"); 64 64 osync_trace(TRACE_SENSITIVE, "event: %i\n alarm: %i\n", 65 65 entry->appointment.event, entry->appointment.alarm); … … 90 90 entry->appointment.repeatDays[5], entry->appointment.repeatDays[6], 91 91 entry->appointment.repeatWeekstart); 92 osync_trace(TRACE_SENSITIVE, "execptions: %i\n tm_exception: NULL\n description: %s\n note: %s\n", 93 entry->appointment.exceptions, entry->appointment.description, entry->appointment.note); 92 osync_trace(TRACE_SENSITIVE, "execptions: %i\n tm_exception: NULL\n description: %s\n note: %s\n", entry->appointment.exceptions, entry->appointment.description ? entry->appointment.description : "nil", entry->appointment.note ? entry->appointment.note : "nil"); 94 93 95 94 int i; … … 143 142 xmlNewTextChild(current, NULL, (xmlChar*) "Value", (xmlChar*)"DATE"); 144 143 145 osync_trace(TRACE_SENSITIVE, "Start: %s", vtime );144 osync_trace(TRACE_SENSITIVE, "Start: %s", vtime ? vtime : "nil"); 146 145 147 146 g_free(tmp); … … 157 156 xmlNewTextChild(current, NULL, (xmlChar*) "Value", (xmlChar*)"DATE"); 158 157 159 osync_trace(TRACE_SENSITIVE, "End: %s", vtime );158 osync_trace(TRACE_SENSITIVE, "End: %s", vtime ? vtime : "nil"); 160 159 161 160 g_free(tmp); … … 172 171 xmlNewTextChild(current, NULL, (xmlChar*)"Content", (xmlChar*)vtime); 173 172 174 osync_trace(TRACE_SENSITIVE, "Start: %s", vtime );173 osync_trace(TRACE_SENSITIVE, "Start: %s", vtime ? vtime : "nil"); 175 174 176 175 g_free(vtime); … … 184 183 xmlNewTextChild(current, NULL, (xmlChar*)"Content", (xmlChar*)vtime); 185 184 186 osync_trace(TRACE_SENSITIVE, "End: %s", vtime );185 osync_trace(TRACE_SENSITIVE, "End: %s", vtime ? vtime : "nil"); 187 186 188 187 g_free(vtime); … … 375 374 *outpsize = sizeof(doc); 376 375 377 osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s", osxml_write_to_string((xmlDoc *)doc) );376 osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s", osxml_write_to_string((xmlDoc *)doc) ? osxml_write_to_string((xmlDoc *)doc) : "nil"); 378 377 379 378 osync_trace(TRACE_EXIT, "%s", __func__); … … 381 380 382 381 error: 383 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );382 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 384 383 return FALSE; 385 384 } … … 389 388 osync_trace(TRACE_ENTRY, "%s(%p, %p, %i, %p, %p, %p, %p)", __func__, user_data, input, inpsize, output, outpsize, free_input, error); 390 389 391 osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", osxml_write_to_string((xmlDoc *)input) );390 osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", osxml_write_to_string((xmlDoc *)input) ? osxml_write_to_string((xmlDoc *)input) : "nil"); 392 391 393 392 int i = 0; … … 479 478 entry->appointment.begin.tm_min, 480 479 entry->appointment.begin.tm_sec, 481 vtime );480 vtime ? vtime : "nil"); 482 481 483 482 g_free(vtime); … … 510 509 entry->appointment.end.tm_min, 511 510 entry->appointment.end.tm_sec, 512 vtime );511 vtime ? vtime : "nil"); 513 512 514 513 g_free(vtime); … … 707 706 // when repeat_end is euqal or less then begin palm shows strange phenomenons 708 707 if ((unsigned int) mktime(repeat_end) > (unsigned int) mktime(&(entry->appointment.begin))) { 709 osync_trace(TRACE_INTERNAL, "UNTIL: %s", vtime );708 osync_trace(TRACE_INTERNAL, "UNTIL: %s", vtime ? vtime : "nil"); 710 709 entry->appointment.repeatEnd = *repeat_end; 711 710 entry->appointment.repeatForever = 0; … … 762 761 763 762 error: 764 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );763 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 765 764 return FALSE; 766 765 } … … 961 960 pos += 1; 962 961 963 osync_trace(TRACE_SENSITIVE, "codepage: [%s]", newevent->codepage );962 osync_trace(TRACE_SENSITIVE, "codepage: [%s]", newevent->codepage ? newevent->codepage : "nil"); 964 963 965 964 osync_trace(TRACE_SENSITIVE, "note: [%s] desc: [%s]", 966 newevent->appointment.note ,967 newevent->appointment.description );965 newevent->appointment.note ? newevent->appointment.note : "nil", 966 newevent->appointment.description ? newevent->appointment.description : "nil"); 968 967 969 968 *output = (char*) newevent; … … 1071 1070 *outpsize = sizeof(doc); 1072 1071 1073 osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s", osxml_write_to_string((xmlDoc *)doc) );1072 osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s", osxml_write_to_string((xmlDoc *)doc) ? osxml_write_to_string((xmlDoc *)doc) : "nil"); 1074 1073 1075 1074 osync_trace(TRACE_EXIT, "%s", __func__); … … 1077 1076 1078 1077 error: 1079 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );1078 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 1080 1079 return FALSE; 1081 1080 } … … 1087 1086 char *tmp = NULL; 1088 1087 1089 osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", osxml_write_to_string((xmlDoc *)input) );1088 osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", osxml_write_to_string((xmlDoc *)input) ? osxml_write_to_string((xmlDoc *)input) : "nil"); 1090 1089 1091 1090 //Get the root node of the input document … … 1185 1184 1186 1185 error: 1187 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );1186 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 1188 1187 return FALSE; 1189 1188 } … … 1366 1365 pos += 1; 1367 1366 1368 osync_trace(TRACE_SENSITIVE, "codepage: [%s]", n ewtodo->codepage);1367 osync_trace(TRACE_SENSITIVE, "codepage: [%s]", nnewtodo->codepage ? ewtodo->codepage : "nil"); 1369 1368 1370 1369 1371 1370 osync_trace(TRACE_SENSITIVE, "desc: [%s] note: [%s]", 1372 newtodo->todo.description ,1373 newtodo->todo.note );1371 newtodo->todo.description ? newtodo->todo.description : "nil", 1372 newtodo->todo.note ? newtodo->todo.note : "nil"); 1374 1373 1375 1374 *output = (char*) newtodo; … … 1389 1388 char *tmp = NULL; 1390 1389 1391 osync_trace(TRACE_SENSITIVE, "Entry: %s (%p)", entry->address.entry[i] , entry->address.entry[i]);1390 osync_trace(TRACE_SENSITIVE, "Entry: %s (%p)", entry->address.entry[i] ? entry->address.entry[i] : "nil", entry->address.entry[i]); 1392 1391 if (entry->address.entry[i] && strlen(entry->address.entry[i]) > 0) 1393 1392 tmp = conv_enc_palm_to_xml(entry->address.entry[i]); … … 1404 1403 static osync_bool conv_palm_contact_to_xml(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, OSyncError **error) 1405 1404 { 1406 osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p, %p, %s, %p)", __func__, input, inpsize, output, outpsize, free_input, config , error);1405 osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p, %p, %s, %p)", __func__, input, inpsize, output, outpsize, free_input, config ? config : "nil", error); 1407 1406 1408 1407 PSyncContactEntry *entry = (PSyncContactEntry *)input; … … 1418 1417 1419 1418 for (i = 0; i < 19; i++) 1420 osync_trace(TRACE_SENSITIVE, "entry %i: %s", i, entry->address.entry[i] );1419 osync_trace(TRACE_SENSITIVE, "entry %i: %s", i, entry->address.entry[i] ? entry->address.entry[i] : "nil"); 1421 1420 1422 1421 //Create a new xml document … … 1455 1454 current = xmlNewTextChild(root, NULL, (xmlChar*)"FormattedName", NULL); 1456 1455 osxml_node_add(current, "Content", formatted_name->str); 1457 osync_trace(TRACE_SENSITIVE, "FormattedName: \"%s\"", formatted_name->str );1456 osync_trace(TRACE_SENSITIVE, "FormattedName: \"%s\"", formatted_name->str ? formatted_name->str : "nil"); 1458 1457 1459 1458 g_string_free(formatted_name, TRUE); … … 1591 1590 *outpsize = sizeof(doc); 1592 1591 1593 osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s", osxml_write_to_string((xmlDoc *)doc) );1592 osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s", osxml_write_to_string((xmlDoc *)doc) ? osxml_write_to_string((xmlDoc *)doc) : "nil"); 1594 1593 1595 1594 osync_trace(TRACE_EXIT, "%s", __func__); … … 1597 1596 1598 1597 error: 1599 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );1598 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 1600 1599 return FALSE; 1601 1600 } … … 1603 1602 static osync_bool conv_xml_to_palm_contact(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, OSyncError **error) 1604 1603 { 1605 osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p, %p, %s, %p)", __func__, input, inpsize, output, outpsize, free_input, config , error);1606 osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", osxml_write_to_string((xmlDoc *)input) );1604 osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p, %p, %s, %p)", __func__, input, inpsize, output, outpsize, free_input, config ? config : "nil", error); 1605 osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", osxml_write_to_string((xmlDoc *)input) ? osxml_write_to_string((xmlDoc *)input) : "nil"); 1607 1606 1608 1607 char *tmp = NULL; … … 1657 1656 entry->address.entry[3 + i] = (char*)osxml_find_node(cur, "Content"); 1658 1657 1659 osync_trace(TRACE_SENSITIVE, "handling telephone (%s). has work %i, home %i, voice %i", entry->address.entry[3 + i] , osxml_has_property(cur, "WORK"), osxml_has_property(cur, "HOME"), osxml_has_property(cur, "VOICE"));1658 osync_trace(TRACE_SENSITIVE, "handling telephone (%s). has work %i, home %i, voice %i", entry->address.entry[3 + i] ? entry->address.entry[3 + i] : "nil", osxml_has_property(cur, "WORK"), osxml_has_property(cur, "HOME"), osxml_has_property(cur, "VOICE")); 1660 1659 1661 1660 if (osxml_has_property(cur, "WORK")) { … … 1728 1727 g_free(entry->address.entry[i]); 1729 1728 entry->address.entry[i] = tmp; 1730 osync_trace(TRACE_SENSITIVE, "entry %i: %s", i, entry->address.entry[i] );1729 osync_trace(TRACE_SENSITIVE, "entry %i: %s", i, entry->address.entry[i] ? entry->address.entry[i] : "nil"); 1731 1730 } 1732 1731 } … … 1742 1741 1743 1742 error: 1744 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );1743 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 1745 1744 return FALSE; 1746 1745 } … … 1832 1831 static osync_bool conv_palm_note_to_xml(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, OSyncError **error) 1833 1832 { 1834 osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p, %p, %s, %p)", __func__, input, inpsize, output, outpsize, free_input, config , error);1833 osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p, %p, %s, %p)", __func__, input, inpsize, output, outpsize, free_input, config ? config : "nil", error); 1835 1834 PSyncNoteEntry *entry = (PSyncNoteEntry *)input; 1836 1835 … … 1880 1879 *outpsize = sizeof(doc); 1881 1880 1882 osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s", osxml_write_to_string((xmlDoc *)doc) );1881 osync_trace(TRACE_SENSITIVE, "Output XML is:\n%s", osxml_write_to_string((xmlDoc *)doc) ? osxml_write_to_string((xmlDoc *)doc) : "nil"); 1883 1882 1884 1883 osync_trace(TRACE_EXIT, "%s", __func__); … … 1886 1885 1887 1886 error: 1888 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );1887 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 1889 1888 return FALSE; 1890 1889 } … … 1893 1892 static osync_bool conv_xml_to_palm_note(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, OSyncError **error) 1894 1893 { 1895 osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p, %p, %s, %p)", __func__, input, inpsize, output, outpsize, free_input, config , error);1894 osync_trace(TRACE_ENTRY, "%s(%p, %i, %p, %p, %p, %s, %p)", __func__, input, inpsize, output, outpsize, free_input, config ? config : "nil", error); 1896 1895 1897 1896 char *tmp = NULL; … … 1899 1898 GString *memo = g_string_new(""); 1900 1899 1901 osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", osxml_write_to_string((xmlDoc *)input) );1900 osync_trace(TRACE_SENSITIVE, "Input XML is:\n%s", osxml_write_to_string((xmlDoc *)input) ? osxml_write_to_string((xmlDoc *)input) : "nil"); 1902 1901 1903 1902 //Get the root node of the input document … … 1956 1955 1957 1956 error: 1958 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );1957 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 1959 1958 return FALSE; 1960 1959 } … … 2118 2117 pos += 1; 2119 2118 2120 osync_trace(TRACE_SENSITIVE, "codepage: [%s]", newnote->codepage );2119 osync_trace(TRACE_SENSITIVE, "codepage: [%s]", newnote->codepage ? newnote->codepage : "nil"); 2121 2120 2122 2121 osync_trace(TRACE_SENSITIVE, "memo.text: [%s]", 2123 newnote->memo.text );2122 newnote->memo.text ? newnote->memo.text : "nil"); 2124 2123 2125 2124 *output = (char*) newnote; plugins/palm/src/palm_note.c
r1222 r2437 60 60 const char *catname = psyncDBCategoryFromId(entry->db, entry->category, NULL); 61 61 if (catname) { 62 osync_trace(TRACE_INTERNAL, "CATNAME: %s", catname );62 osync_trace(TRACE_INTERNAL, "CATNAME: %s", catname ? catname: "nil"); 63 63 note->categories = g_list_append(note->categories, g_strdup(catname)); 64 64 } else { … … 81 81 osync_change_free(change); 82 82 error: 83 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );83 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 84 84 return NULL; 85 85 } … … 145 145 psyncDBClose(db); 146 146 error: 147 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );147 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 148 148 return FALSE; 149 149 } … … 204 204 GList *c = NULL; 205 205 for (c = note->categories; c; c = c->next) { 206 osync_trace(TRACE_INTERNAL, "searching category %s\n", c->data );206 osync_trace(TRACE_INTERNAL, "searching category %s\n", c->data ? c->data : "nil"); 207 207 entry->category = psyncDBCategoryToId(db, c->data, NULL); 208 208 if (entry->category != 0) { … … 254 254 error: 255 255 osync_context_report_osyncerror(ctx, &error); 256 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) );256 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) ? osync_error_print(&error) : "nil"); 257 257 return FALSE; 258 258 } … … 290 290 const char *catname = psyncDBCategoryFromId(entry->db, entry->category, NULL); 291 291 if (catname) { 292 osync_trace(TRACE_INTERNAL, "CATNAME: %s", catname );292 osync_trace(TRACE_INTERNAL, "CATNAME: %s", catname ? catname : "nil"); 293 293 note->categories = g_list_append(note->categories, g_strdup(catname)); 294 294 } 295 295 296 osync_trace(TRACE_INTERNAL, "read memo: %s", note->memo.text );296 osync_trace(TRACE_INTERNAL, "read memo: %s", note->memo.text ? note->memo.text : "nil"); 297 297 osync_change_set_data(change, (void *)note, sizeof(PSyncNoteEntry), TRUE); 298 298 plugins/palm/src/palm_sync.c
r2333 r2437 91 91 PSyncDatabase *psyncDBOpen(PSyncEnv *env, char *name, OSyncError **error) 92 92 { 93 osync_trace(TRACE_ENTRY, "%s(%p, %s, %p)", __func__, env, name , error);93 osync_trace(TRACE_ENTRY, "%s(%p, %s, %p)", __func__, env, name ? name : "nil", error); 94 94 95 95 struct DBInfo dbInfo; … … 157 157 g_free(db); 158 158 error: 159 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );159 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 160 160 return NULL; 161 161 } … … 205 205 error: 206 206 if (osync_error_is_set(error)) 207 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );207 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 208 208 else 209 209 osync_trace(TRACE_EXIT, "%s: Not Found", __func__); … … 255 255 error: 256 256 if (osync_error_is_set(error)) 257 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );257 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 258 258 else 259 259 osync_trace(TRACE_EXIT, "%s: Not Found", __func__); … … 306 306 error: 307 307 if (osync_error_is_set(error)) 308 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );308 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 309 309 else 310 310 osync_trace(TRACE_EXIT, "%s: Not Found", __func__); … … 326 326 327 327 error: 328 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );328 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 329 329 return FALSE; 330 330 } … … 352 352 353 353 error: 354 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );354 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 355 355 return FALSE; 356 356 } … … 385 385 386 386 error: 387 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );387 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 388 388 return FALSE; 389 389 } … … 400 400 const char *ret = db->cai.name[id]; 401 401 402 osync_trace(TRACE_EXIT, "%s: %s", __func__, ret );402 osync_trace(TRACE_EXIT, "%s: %s", __func__, ret ? ret : "nil"); 403 403 return ret; 404 404 405 405 error: 406 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );406 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 407 407 return NULL; 408 408 } … … 410 410 int psyncDBCategoryToId(PSyncDatabase *db, const char *name, OSyncError **error) 411 411 { 412 osync_trace(TRACE_ENTRY, "%s(%p, %s, %p)", __func__, db, name , error);412 osync_trace(TRACE_ENTRY, "%s(%p, %s, %p)", __func__, db, name ? name : "nil", error); 413 413 414 414 int i = 0; 415 415 for (i = 0; i < CATCOUNT; i++) { 416 416 if (db->cai.name[i][0] != '\0') { 417 osync_trace(TRACE_INTERNAL, "remote: cat %d [%s] ID %d renamed %d", i, db->cai.name[i] , db->cai.ID[i], db->cai.renamed[i]);417 osync_trace(TRACE_INTERNAL, "remote: cat %d [%s] ID %d renamed %d", i, db->cai.name[i] ? db->cai.name[i] : "nil", db->cai.ID[i], db->cai.renamed[i]); 418 418 if (!strcmp(db->cai.name[i], name)) { 419 419 osync_trace(TRACE_EXIT, "%s: %i", __func__, i); … … 501 501 pi_close(listen_sd); 502 502 error: 503 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );503 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 504 504 return FALSE; 505 505 } … … 564 564 static osync_bool psyncSettingsParse(PSyncEnv *env, const char *config, OSyncError **error) 565 565 { 566 osync_trace(TRACE_ENTRY, "%s(%p, %s, %p)", __func__, env, config , error);566 osync_trace(TRACE_ENTRY, "%s(%p, %s, %p)", __func__, env, config ? config : "nil", error); 567 567 xmlDoc *doc = NULL; 568 568 xmlNode *cur = NULL; … … 643 643 xmlFreeDoc(doc); 644 644 error: 645 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );645 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 646 646 return FALSE; 647 647 } … … 684 684 strcpy(env->user.username, ""); 685 685 686 osync_trace(TRACE_INTERNAL, "User: %s, %i\n", env->user.username , env->user.userID);686 osync_trace(TRACE_INTERNAL, "User: %s, %i\n", env->user.username ? env->user.username : "nil", env->user.userID); 687 687 /*if (strcmp(User.username, conn->username) || User.userID != conn->id) { 688 688 //Id or username mismatch … … 729 729 730 730 osync_context_report_osyncerror(ctx, error); 731 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) );731 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) ? osync_error_print(&error) : "nil"); 732 732 } 733 733 … … 812 812 g_free(env); 813 813 error: 814 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );814 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 815 815 return NULL; 816 816 } … … 857 857 858 858 error: 859 osync_trace(TRACE_ERROR, "Unable to register: %s", osync_error_print(error) );859 osync_trace(TRACE_ERROR, "Unable to register: %s", osync_error_print(error) ? osync_error_print(error) : "nil"); 860 860 osync_error_unref(error); 861 861 return FALSE; plugins/palm/src/palm_todo.c
r1222 r2437 80 80 osync_change_free(change); 81 81 error: 82 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );82 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 83 83 return NULL; 84 84 } … … 144 144 psyncDBClose(db); 145 145 error: 146 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) );146 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error) ? osync_error_print(error) : "nil"); 147 147 return FALSE; 148 148 } … … 202 202 GList *c = NULL; 203 203 for (c = todo->categories; c; c = c->next) { 204 osync_trace(TRACE_INTERNAL, "searching category %s\n", c->data );204 osync_trace(TRACE_INTERNAL, "searching category %s\n", c->data ? c->data : "nil"); 205 205 entry->category = psyncDBCategoryToId(db, c->data, NULL); 206 206 if (entry->category != 0) { … … 252 252 error: 253 253 osync_context_report_osyncerror(ctx, &error); 254 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) );254 osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error) ? osync_error_print(&error) : "nil"); 255 255 return FALSE; 256 256 }
