From 26c3d55c81b7a33a4d87ba8d2f40a918d2d9f737 Mon Sep 17 00:00:00 2001 From: spv420 Date: Sat, 23 Apr 2022 19:00:46 -0400 Subject: hahahahaha we're all gonna die *hbomberguy intro* --- src/js/primitives/mem.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/js/primitives') diff --git a/src/js/primitives/mem.js b/src/js/primitives/mem.js index b0746b4..551b59f 100644 --- a/src/js/primitives/mem.js +++ b/src/js/primitives/mem.js @@ -169,16 +169,16 @@ function init_sptr_heap() { sptr_size = 0x1000000; sptr_len = 0; - calls4arg("printf\0", sptr("sptr_heap=%p\n\0"), global_sptr_addy, 0, 0); + calls4arg("printf\0", sptr("sptr_heap=%p\n"), global_sptr_addy, 0, 0); return global_sptr_addy; } /* - * sptr is meant to give you a pointer to a specified string + * _sptr is meant to give you a pointer to a specified string * remember your nul's! */ -function sptr(s) { +function _sptr(s) { if ((sptr_len + s.length) >= sptr_size) { /* * expand sptr heap if it's too small @@ -198,4 +198,11 @@ function sptr(s) { write_str(global_sptr_addy, s); global_sptr_addy += s.length; return global_sptr_addy - s.length; +} + +/* + * sptr but with nul + */ +function sptr(s) { + return _sptr(s + "\0"); } \ No newline at end of file -- cgit v1.2.3