Update of /cvsroot/refdb/refdb/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4929
Modified Files:
Tag: Release_0_9_5_stable
risxhandler.c noteshandler.c
Log Message:
fixed unterminated ivonv output
Index: risxhandler.c
===================================================================
RCS file: /cvsroot/refdb/refdb/src/risxhandler.c,v
retrieving revision 1.28.2.3
retrieving revision 1.28.2.4
diff -u -U2 -r1.28.2.3 -r1.28.2.4
--- risxhandler.c 11 Dec 2004 00:05:27 -0000 1.28.2.3
+++ risxhandler.c 15 Dec 2004 01:16:12 -0000 1.28.2.4
@@ -652,5 +652,5 @@
/* with the encodings supported by our database engines, the converted
string can't be longer than the input string */
- outlength = inlength;
+ outlength = inlength + 1;
if ((my_elvalue = (char*)malloc(outlength)) == NULL) {
@@ -700,6 +700,7 @@
free((ptr_ardata->ptr_first)->ptr_elvalue);
}
+ *my_elvalue = '\0'; /* terminate converted string */
(ptr_ardata->ptr_first)->ptr_elvalue = my_elvalue_start;
- (ptr_ardata->ptr_first)->n_elvalue_len = outlength;
+ (ptr_ardata->ptr_first)->n_elvalue_len = strlen((ptr_ardata->ptr_first)->ptr_elvalue);
}
/* else: no conversion required */
Index: noteshandler.c
===================================================================
RCS file: /cvsroot/refdb/refdb/src/noteshandler.c,v
retrieving revision 1.18.2.2
retrieving revision 1.18.2.3
diff -u -U2 -r1.18.2.2 -r1.18.2.3
--- noteshandler.c 25 Oct 2004 21:16:32 -0000 1.18.2.2
+++ noteshandler.c 15 Dec 2004 01:16:12 -0000 1.18.2.3
@@ -644,5 +644,5 @@
/* with the encodings supported by our database engines, the converted
string can't be longer than the input string */
- outlength = inlength;
+ outlength = inlength + 1;
if ((my_elvalue = (char*)malloc(outlength)) == NULL) {
@@ -692,6 +692,8 @@
free((ptr_andata->ptr_first)->ptr_elvalue);
}
+
+ *my_elvalue = '\0'; /* terminate converted string */
(ptr_andata->ptr_first)->ptr_elvalue = my_elvalue_start;
- (ptr_andata->ptr_first)->n_elvalue_len = outlength;
+ (ptr_andata->ptr_first)->n_elvalue_len = strlen((ptr_andata->ptr_first)->ptr_elvalue);
}
/* else: no conversion required */
|