Skip to content

Commit 4985c81

Browse files
author
Patrick Soquet
committed
XS: correct escape #1562
1 parent 8efd087 commit 4985c81

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xs/sources/xsGlobal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,13 @@ void fx_escape(txMachine* the)
296296
else
297297
length = fxAddChunkSizes(the, length, 12);
298298
}
299+
length = fxAddChunkSizes(the, length, 1);
299300
if (length == (src - mxArgv(0)->value.string)) {
300301
mxResult->value.string = mxArgv(0)->value.string;
301302
mxResult->kind = mxArgv(0)->kind;
302303
return;
303304
}
304-
mxResult->value.string = fxNewChunk(the, fxAddChunkSizes(the, length, 1));
305+
mxResult->value.string = fxNewChunk(the, length);
305306
mxResult->kind = XS_STRING_KIND;
306307
src = mxArgv(0)->value.string;
307308
dst = mxResult->value.string;

0 commit comments

Comments
 (0)