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

@ -215,13 +215,13 @@ unsafe extern "C" fn is_extensible(
#[allow(unsafe_code)]
unsafe extern "C" fn class_name(_cx: *mut JSContext, _proxy: HandleObject) -> *const libc::c_char {
&b"WindowProperties\0" as *const _ as *const _
c"WindowProperties".as_ptr()
}
// Maybe this should be a DOMJSClass. See https://bugzilla.mozilla.org/show_bug.cgi?id=787070
#[allow(unsafe_code)]
static CLASS: JSClass = JSClass {
name: b"WindowProperties\0" as *const u8 as *const libc::c_char,
name: c"WindowProperties".as_ptr(),
flags: JSClass_NON_NATIVE |
JSCLASS_IS_PROXY |
JSCLASS_DELAY_METADATA_BUILDER |