Commit 5045b0b4ae5534bd7e9c9fad112ddc755021ba74

Thomas de Grivel 2023-07-10T10:45:48

strange bug on NetBSD

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/libc3/str.c b/libc3/str.c
index 01075aa..cf18523 100644
--- a/libc3/str.c
+++ b/libc3/str.c
@@ -31,7 +31,8 @@ sw str_character (const s_str *str, uw position, character *dest)
   s_str s;
   s = *str;
   while (s.size > 0 && i <= position) {
-    if ((r = str_read_character_utf8(&s, &c)) <= 0)
+    r = str_read_character_utf8(&s, &c);
+    if (r <= 0)
       return -1;
     i++;
   }