aboutsummaryrefslogtreecommitdiffstats
path: root/gb.h
diff options
context:
space:
mode:
authorGravatar gingerBill 2018-06-15 20:01:05 +0100
committerGravatar GitHub 2018-06-15 20:01:05 +0100
commitcf6132dbf3240271a6f593c20f2964df5b1f03dc (patch)
treea7e62d9dd3b04b79a9be9e65435497f4b9870ec1 /gb.h
parentMerge pull request #36 from terickson001/printf_width_fix (diff)
Fix gb_utf8_decode
Diffstat (limited to '')
-rw-r--r--gb.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/gb.h b/gb.h
index edb791d..c27692d 100644
--- a/gb.h
+++ b/gb.h
@@ -1,4 +1,4 @@
-/* gb.h - v0.32 - Ginger Bill's C Helper Library - public domain
+/* gb.h - v0.33 - Ginger Bill's C Helper Library - public domain
- no warranty implied; use at your own risk
This is a single header file with a bunch of useful stuff
@@ -58,6 +58,7 @@ TODOS
- More date & time functions
VERSION HISTORY
+ 0.33 - Minor fixes
0.32 - Minor fixes
0.31 - Add gb_file_remove
0.30 - Changes to gbThread (and gbMutex on Windows)
@@ -6884,8 +6885,6 @@ gb_global gbUtf8AcceptRange const gb__utf8_accept_ranges[] = {
isize gb_utf8_decode(u8 const *str, isize str_len, Rune *codepoint_out) {
-
-
isize width = 0;
Rune codepoint = GB_RUNE_INVALID;
@@ -6894,7 +6893,7 @@ isize gb_utf8_decode(u8 const *str, isize str_len, Rune *codepoint_out) {
u8 x = gb__utf8_first[s0], sz;
u8 b1, b2, b3;
gbUtf8AcceptRange accept;
- if (x > 0xf0) {
+ if (x >= 0xf0) {
Rune mask = (cast(Rune)x >> 31) << 31;
codepoint = (cast(Rune)s0 & (~mask)) | (GB_RUNE_INVALID & mask);
width = 1;
@@ -10816,4 +10815,3 @@ GB_COMPARE_PROC(gb_video_mode_dsc_cmp) {
#endif
#endif // GB_IMPLEMENTATION
-