Replace null-byte terminated string literals with C-string literals (#32716)

* simple conversion from byte string to c-string

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

* convert byte strings to c-strings to c_char ptr

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

---------

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>
This commit is contained in:
Bumsoo Kim 2024-07-06 16:14:15 -04:00 committed by GitHub
parent 59d0f1fe1a
commit 141a594e23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 29 additions and 29 deletions

View file

@ -697,7 +697,7 @@ unsafe fn append_cross_origin_allowlisted_prop_keys(
) {
rooted!(in(*cx) let mut id: jsid);
let jsstring = JS_AtomizeAndPinString(*cx, b"then\0".as_ptr() as *const c_char);
let jsstring = JS_AtomizeAndPinString(*cx, c"then".as_ptr());
rooted!(in(*cx) let rooted = jsstring);
RUST_INTERNED_STRING_TO_JSID(*cx, rooted.handle().get(), id.handle_mut());
AppendToIdVector(props, id.handle());