Ensure that format strings are null-terminated

u8 constants are implicitly null-terminated, but it's not really documented.
This commit is contained in:
Susko3 2025-12-13 02:29:00 +01:00
parent 40707381f6
commit 2b556b39ce
1 changed files with 2 additions and 2 deletions

View File

@ -8,14 +8,14 @@ namespace SDL
[Macro] [Macro]
public static unsafe SDLBool SDL_Unsupported() public static unsafe SDLBool SDL_Unsupported()
{ {
fixed (byte* fmt = "That operation is not supported"u8) fixed (byte* fmt = "That operation is not supported\0"u8)
return SDL_SetError(fmt, __arglist()); return SDL_SetError(fmt, __arglist());
} }
[Macro] [Macro]
public static unsafe SDLBool SDL_InvalidParamError([NativeTypeName("const char *")] byte* param) public static unsafe SDLBool SDL_InvalidParamError([NativeTypeName("const char *")] byte* param)
{ {
fixed (byte* fmt = "Parameter '%s' is invalid"u8) fixed (byte* fmt = "Parameter '%s' is invalid\0"u8)
return SDL_SetError(fmt, __arglist(param)); return SDL_SetError(fmt, __arglist(param));
} }
} }