summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/js/lib/myutils.js8
-rw-r--r--src/js/main.js4
2 files changed, 9 insertions, 3 deletions
diff --git a/src/js/lib/myutils.js b/src/js/lib/myutils.js
index 0d10182..80d4d9b 100644
--- a/src/js/lib/myutils.js
+++ b/src/js/lib/myutils.js
@@ -1,3 +1,9 @@
function puts(s) {
- return calls4arg("puts\0", sptr(s), 0, 0, 0);
+ return calls4arg("puts\0", sptr(s + "\0"), 0, 0, 0);
+}
+
+function printf() {
+ for (var i = 0; i < arguments.length; i++) {
+ puts(arguments[i]);
+ }
} \ No newline at end of file
diff --git a/src/js/main.js b/src/js/main.js
index b67ba34..e040d05 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -34,8 +34,8 @@ function main() {
init_sptr_heap();
- puts("we out here\0");
- puts("I came through a portal holding a 40 and a blunt. Do you really wanna test me right now?\0");
+ puts("we out here");
+ puts("I came through a portal holding a 40 and a blunt. Do you really wanna test me right now?");
log("slide=0x" + slide.toString(16));
log("*(uint8_t*)base = 0x" + read_u8(base).toString(16));