diff --git a/src/core/pp.c b/src/core/pp.c index 0c9e81ce..618f7515 100644 --- a/src/core/pp.c +++ b/src/core/pp.c @@ -1066,7 +1066,7 @@ void janet_buffer_format( if (form[2] == '\0') janet_buffer_push_bytes(b, s, l); else { - if (l != (int32_t) strlen((const char *) s)) + if (l != (int32_t) strnlen((const char *) s, l)) janet_panic("string contains zeros"); if (!strchr(form, '.') && l >= 100) { janet_panic("no precision and string is too long to be formatted");