Changeset: f934d1dc36e1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f934d1dc36e1
Modified Files:
monetdb5/modules/atoms/json_atom.c
Branch: default
Log Message:
json_atom.c: do not unconditionally (and unnecessarily) cast a BATcount to int;
with this fix, the code might also work correctly with BATs holding more then 2
billion BUNs.
diffs (21 lines):
diff --git a/monetdb5/modules/atoms/json_atom.c
b/monetdb5/modules/atoms/json_atom.c
--- a/monetdb5/modules/atoms/json_atom.c
+++ b/monetdb5/modules/atoms/json_atom.c
@@ -833,7 +833,7 @@ JSONrenderobject(Client cntxt, MalBlkPtr
row = JSONrenderRowObject(bl,mb,stk,pci,j);
l =strlen(row);
if (l +2 > lim-len)
- row= (char*) GDKrealloc(row, lim = ((int)cnt *
l) <= lim? (int)cnt*l: lim+BUFSIZ);
+ row= (char*) GDKrealloc(row, lim = cnt * l <=
lim? cnt*l: lim+BUFSIZ);
strncpy(result+len,row, l+1);
GDKfree(row);
len +=l;
@@ -907,7 +907,7 @@ JSONrenderarray(Client cntxt, MalBlkPtr
row = JSONrenderRowArray(bl,mb,pci,j);
l =strlen(row);
if (l +2 > lim-len)
- row= (char*) GDKrealloc(row, lim = ((int)cnt *
l) <= lim? (int)cnt*l: lim+BUFSIZ);
+ row= (char*) GDKrealloc(row, lim = cnt * l <=
lim? cnt*l: lim+BUFSIZ);
strncpy(result+len,row, l+1);
GDKfree(row);
len +=l;
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list