Subject: Fix comparision if (char) is unsigned
From: "IOhannes m zmölnig (Debian/GNU)"<[email-masked]>
Date: Wed, 2 Aug 2023 11:31:35 +0200

Bug: https://github.com/obsproject/obs-studio/pull/9184
---
 deps/libcaption/src/utf8.c | 2 +-
 libobs/util/utf8.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- obs-studio.orig/deps/libcaption/src/utf8.c
+++ obs-studio/deps/libcaption/src/utf8.c
@@ -51,7 +51,7 @@
 int utf8_char_whitespace(const utf8_char_t* c)
 {
     // 0x7F is DEL
-    if (!c || (c[0] >= 0 && c[0] <= ' ') || c[0] == 0x7F) {
+    if (!c || ((signed char)c[0] >= 0 && c[0] <= ' ') || c[0] == 0x7F) {
         return 1;
     }
 
--- obs-studio.orig/libobs/util/utf8.c
+++ obs-studio/libobs/util/utf8.c
@@ -289,7 +289,7 @@
 		if (*w == _BOM && (flags & UTF8_SKIP_BOM) != 0)
 			continue;
 
-		if (*w < 0) {
+		if ((signed char)*w < 0) {
 			if ((flags & UTF8_IGNORE_ERROR) == 0)
 				return 0;
 			continue;