mirror of
https://github.com/janet-lang/janet
synced 2025-01-11 08:00:27 +00:00
Merge pull request #1314 from williewillus/pr1314
Use libc strlen in janet_buffer_push_cstring
This commit is contained in:
commit
46b34833c2
@ -135,8 +135,7 @@ void janet_buffer_extra(JanetBuffer *buffer, int32_t n) {
|
|||||||
|
|
||||||
/* Push a cstring to buffer */
|
/* Push a cstring to buffer */
|
||||||
void janet_buffer_push_cstring(JanetBuffer *buffer, const char *cstring) {
|
void janet_buffer_push_cstring(JanetBuffer *buffer, const char *cstring) {
|
||||||
int32_t len = 0;
|
int32_t len = strlen(cstring);
|
||||||
while (cstring[len]) ++len;
|
|
||||||
janet_buffer_push_bytes(buffer, (const uint8_t *) cstring, len);
|
janet_buffer_push_bytes(buffer, (const uint8_t *) cstring, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user