Update of /cvsroot/refdb/refdb/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8160/src
Modified Files:
Tag: Release_0_9_5_stable
backend-dbiba.c
Log Message:
fixed off-by-one error in character conversions
Index: backend-dbiba.c
===================================================================
RCS file: /cvsroot/refdb/refdb/src/backend-dbiba.c,v
retrieving revision 1.26.2.3
retrieving revision 1.26.2.4
diff -u -U2 -r1.26.2.3 -r1.26.2.4
--- backend-dbiba.c 15 Jun 2004 22:26:36 -0000 1.26.2.3
+++ backend-dbiba.c 24 Jun 2004 20:29:57 -0000 1.26.2.4
@@ -1236,10 +1236,12 @@
}
- if ((new_ref = format_month(*ptr_ref, ptr_ref_len, item_dateother, item_monthformat, item_pad, dbires_cit)) == NULL) {
- delete_all_lilimem(&sentinel);
- return NULL;
- }
- else {
- *ptr_ref = new_ref;
+ if (item_dateother && *item_dateother) {
+ if ((new_ref = format_month(*ptr_ref, ptr_ref_len, item_dateother, item_monthformat, item_pad, dbires_cit)) == NULL) {
+ delete_all_lilimem(&sentinel);
+ return NULL;
+ }
+ else {
+ *ptr_ref = new_ref;
+ }
}
@@ -1280,11 +1282,12 @@
if (item_dateother && *item_dateother) {
nhave_content = 1;
- }
- if ((new_ref = format_month(*ptr_ref, ptr_ref_len, item_dateother, item_monthformat, item_pad, dbires_cit)) == NULL) {
- delete_all_lilimem(&sentinel);
- return NULL;
- }
- else {
- *ptr_ref = new_ref;
+
+ if ((new_ref = format_month(*ptr_ref, ptr_ref_len, item_dateother, item_monthformat, item_pad, dbires_cit)) == NULL) {
+ delete_all_lilimem(&sentinel);
+ return NULL;
+ }
+ else {
+ *ptr_ref = new_ref;
+ }
}
@@ -1301,10 +1304,12 @@
}
- if ((new_ref = format_day(*ptr_ref, ptr_ref_len, item_dateother, item_dayformat, item_pad)) == NULL) {
- delete_all_lilimem(&sentinel);
- return NULL;
- }
- else {
- *ptr_ref = new_ref;
+ if (item_dateother && *item_dateother) {
+ if ((new_ref = format_day(*ptr_ref, ptr_ref_len, item_dateother, item_dayformat, item_pad)) == NULL) {
+ delete_all_lilimem(&sentinel);
+ return NULL;
+ }
+ else {
+ *ptr_ref = new_ref;
+ }
}
|