diff options
| author | spv420 <unomilliono@gmail.com> | 2022-04-23 19:00:46 -0400 |
|---|---|---|
| committer | spv420 <unomilliono@gmail.com> | 2022-04-23 19:00:46 -0400 |
| commit | 26c3d55c81b7a33a4d87ba8d2f40a918d2d9f737 (patch) | |
| tree | 5911108f2bdb563c518347b662e12b916b469931 /src/js/primitives/mem.js | |
| parent | bc3e2818f1c96289f1db2ed367274fb7bb06e89a (diff) | |
hahahahaha we're all gonna die *hbomberguy intro*
Diffstat (limited to 'src/js/primitives/mem.js')
| -rw-r--r-- | src/js/primitives/mem.js | 13 |
1 files changed, 10 insertions, 3 deletions
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 |
