Skip to content

Commit addb28f

Browse files
committed
Try to fix failing tests
1 parent ecb00f3 commit addb28f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

storage/connect/json.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ PSZ JOBJECT::GetText(PGLOBAL g, PSZ text)
10531053
return text;
10541054

10551055
if (!text) {
1056-
text = (char*)PlugSubAlloc(g, NULL, 0);
1056+
text = (char*)PlugSubAlloc(g, NULL, 512); // TODO: get size
10571057
text[0] = 0;
10581058
n = 1;
10591059
} else
@@ -1079,8 +1079,8 @@ PSZ JOBJECT::GetText(PGLOBAL g, PSZ text)
10791079
} else for (PJPR jp = First; jp; jp = jp->Next)
10801080
jp->Val->GetText(g, text);
10811081

1082-
if (n)
1083-
PlugSubAlloc(g, NULL, strlen(text) + 1);
1082+
//if (n)
1083+
// PlugSubAlloc(g, NULL, strlen(text) + 1);
10841084

10851085
return text + n;
10861086
} // end of GetText;
@@ -1290,7 +1290,7 @@ PSZ JARRAY::GetText(PGLOBAL g, PSZ text)
12901290
PJVAL jp;
12911291

12921292
if (!text) {
1293-
text = (char*)PlugSubAlloc(g, NULL, 0);
1293+
text = (char*)PlugSubAlloc(g, NULL, 512);
12941294
text[0] = 0;
12951295
n = 1;
12961296
} else
@@ -1299,8 +1299,8 @@ PSZ JARRAY::GetText(PGLOBAL g, PSZ text)
12991299
for (jp = First; jp; jp = jp->Next)
13001300
jp->GetText(g, text);
13011301

1302-
if (n)
1303-
PlugSubAlloc(g, NULL, strlen(text) + 1);
1302+
//if (n)
1303+
// PlugSubAlloc(g, NULL, strlen(text) + 1);
13041304

13051305
return text + n;
13061306
} // end of GetText;
@@ -1536,8 +1536,7 @@ PSZ JVALUE::GetString(PGLOBAL g)
15361536
p = (char*)PlugDup(g, (Val->B) ? "true" : "false");
15371537
break;
15381538
case TYPE_NULL:
1539-
p = (char*)PlugDup(g, "null")
1540-
;
1539+
p = (char*)PlugDup(g, "null");
15411540
break;
15421541
default:
15431542
p = NULL;
@@ -1546,7 +1545,7 @@ PSZ JVALUE::GetString(PGLOBAL g)
15461545
} else
15471546
p = NULL;
15481547

1549-
return (p == buf)? (char*)PlugDup(g, buf) : p;
1548+
return (p == buf) ? (char*)PlugDup(g, buf) : p;
15501549
} // end of GetString
15511550

15521551
/***********************************************************************/

0 commit comments

Comments
 (0)