janet-lang / spork

Various Janet utility modules - the official "Contrib" library.
MIT License
122 stars 35 forks source link

Fix panic arg in `raw_term.c:extract_codepoint` #93

Closed Techcable closed 1 year ago

Techcable commented 1 year ago

I got the following error in clang:

src/rawterm.c:345:18: warning: passing 'char[18]' to parameter of type 'JanetString' (aka 'const unsigned char *') converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    janet_panics("invalid codepoint");
                 ^~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/janet/1.25.1/include/janet/janet.h:1957:57: note: passing argument to parameter 'message' here
JANET_NO_RETURN JANET_API void janet_panics(JanetString message);
                                                        ^

This change should fix the error and avoid undefined behavior.