From: Peter Verthez Date: Sun, 30 Dec 2001 22:44:13 +0000 (+0000) Subject: Error routines should provide messages without newlines appended. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=77989125b676e463aa052e0fd22f5bcb98d0ff77;p=gedcom-parse.git Error routines should provide messages without newlines appended. --- diff --git a/gedcom/message.c b/gedcom/message.c index 49e91e5..68a7c85 100644 --- a/gedcom/message.c +++ b/gedcom/message.c @@ -94,7 +94,6 @@ int gedcom_message(char* s, ...) reset_mess_buffer(); res = safe_buf_vappend(s, ap); va_end(ap); - safe_buf_append("\n"); if (msg_handler) (*msg_handler)(MESSAGE, mess_buffer); return res; @@ -110,7 +109,6 @@ int gedcom_warning(char* s, ...) va_start(ap, s); res = safe_buf_vappend(s, ap); va_end(ap); - safe_buf_append("\n"); if (msg_handler) (*msg_handler)(WARNING, mess_buffer); @@ -127,7 +125,6 @@ int gedcom_error(char* s, ...) va_start(ap, s); res = safe_buf_vappend(s, ap); va_end(ap); - safe_buf_append("\n"); if (msg_handler) (*msg_handler)(ERROR, mess_buffer); diff --git a/standalone.c b/standalone.c index 55948cd..863da53 100644 --- a/standalone.c +++ b/standalone.c @@ -59,7 +59,7 @@ void show_help () printf(" -3 Run the test parse 3 times instead of once\n"); } -Gedcom_ctxt header_start(int level, char *xref, char *tag) +Gedcom_ctxt header_start(int level, Gedcom_val xref, char *tag) { output(1, "Header start\n"); return (Gedcom_ctxt)0; @@ -73,10 +73,10 @@ void header_end(Gedcom_ctxt self) char family_xreftags[100][255]; int family_nr = 0; -Gedcom_ctxt family_start(int level, char *xref, char *tag) +Gedcom_ctxt family_start(int level, Gedcom_val xref, char *tag) { - output(1, "Family start, xref is %s\n", xref); - strcpy(family_xreftags[family_nr], xref); + output(1, "Family start, xref is %s\n", GEDCOM_STRING(xref)); + strcpy(family_xreftags[family_nr], GEDCOM_STRING(xref)); return (Gedcom_ctxt)(family_nr++); } @@ -85,9 +85,9 @@ void family_end(Gedcom_ctxt self) output(1, "Family end, xref is %s\n", family_xreftags[(int)self]); } -Gedcom_ctxt submit_start(int level, char *xref, char *tag) +Gedcom_ctxt submit_start(int level, Gedcom_val xref, char *tag) { - output(1, "Submitter, xref is %s\n", xref); + output(1, "Submitter, xref is %s\n", GEDCOM_STRING(xref)); return (Gedcom_ctxt)10000; } @@ -157,7 +157,7 @@ void gedcom_message_handler(Gedcom_msg_type type, char *msg) fprintf(stderr, "WARNING: "); else if (type == ERROR) fprintf(stderr, "ERROR: "); - fprintf(stderr, msg); + fprintf(stderr, "%s\n", msg); } int main(int argc, char* argv[])