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(
10601060 break ;
10611061 }
10621062 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 );
10661064 if (form [2 ] == '\0' )
1067- janet_buffer_push_bytes (b , s , l );
1065+ janet_buffer_push_cstring (b , s );
10681066 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 );
10761068 }
10771069 break ;
10781070 }
You can’t perform that action at this time.
0 commit comments