summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.c b/main.c
index 9304259..f55221c 100644
--- a/main.c
+++ b/main.c
@@ -4,8 +4,10 @@
static void handle_success(emscripten_fetch_t *fetch)
{
- printf("Finished downloading %llu bytes of %s from URL %s.\n",
- fetch->numBytes, fetch->data, fetch->url);
+ char data[fetch->numBytes + 1];
+ strlcpy(data, fetch->data, fetch->numBytes + 1);
+ printf("Finished downloading %llu bytes of %s from URL %s.\n", fetch->numBytes, data,
+ fetch->url);
emscripten_fetch_close(fetch);
}