mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 14:31:10 +01:00
Fix hb_in_range() for types smaller than int
As exercised by hb-coretext .notdef code.
This commit is contained in:
1 parent
26a963b9cb
commit
c2b151d952
1 file changed
+3
-1
+3
-1
@@ -848,7 +848,9 @@ hb_in_range (T u, T lo, T hi)
|
||||
* to generate a warning than unused variables. */
|
||||
ASSERT_STATIC (sizeof (hb_assert_unsigned_t<T>) >= 0);
|
||||
|
||||
return (u - lo) <= (hi - lo);
|
||||
/* The casts below are important as if T is smaller than int,
|
||||
* the subtract results will become a signed int! */
|
||||
return (T)(u - lo) <= (T)(hi - lo);
|
||||
}
|
||||
|
||||
template <typename T> static inline bool
|
||||
|
||||
Reference in new issue
Block a user