mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-07-29 00:26:14 -04:00
libcaption: Optimize branch conditons
The optimization silences the warning about type limits on platforms with `char` type as `unsigned char`. The original condition is semantically identical to the optimized one because the signed-to-unsigned cast is well-defined in C standard.
This commit is contained in:
2
deps/libcaption/src/utf8.c
vendored
2
deps/libcaption/src/utf8.c
vendored
@@ -51,7 +51,7 @@ size_t utf8_char_length(const utf8_char_t* c)
|
||||
int utf8_char_whitespace(const utf8_char_t* c)
|
||||
{
|
||||
// 0x7F is DEL
|
||||
if (!c || (c[0] >= 0 && c[0] <= ' ') || c[0] == 0x7F) {
|
||||
if (!c || (unsigned char)c[0] <= ' ' || c[0] == 0x7F) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user