File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -1060,19 +1060,11 @@ void janet_buffer_format(
1060
1060
break ;
1061
1061
}
1062
1062
case 's' : {
1063
- JanetByteView bytes = janet_getbytes (argv , arg );
1064
- const uint8_t * s = bytes .bytes ;
1065
- int32_t l = bytes .len ;
1063
+ const char * s = janet_getcbytes (argv , arg );
1066
1064
if (form [2 ] == '\0' )
1067
- janet_buffer_push_bytes (b , s , l );
1065
+ janet_buffer_push_cstring (b , s );
1068
1066
else {
1069
- if (l != (int32_t ) strnlen ((const char * ) s , l ))
1070
- janet_panic ("string contains zeros" );
1071
- if (!strchr (form , '.' ) && l >= 100 ) {
1072
- janet_panic ("no precision and string is too long to be formatted" );
1073
- } else {
1074
- nb = snprintf (item , MAX_ITEM , form , s );
1075
- }
1067
+ nb = snprintf (item , MAX_ITEM , form , s );
1076
1068
}
1077
1069
break ;
1078
1070
}
You can’t perform that action at this time.
0 commit comments