]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
utf8: Make `decode` a void function -- its return value is always ignored.
authorFlorian Forster <octo@collectd.org>
Fri, 22 Dec 2023 14:32:30 +0000 (15:32 +0100)
committerFlorian Forster <octo@collectd.org>
Thu, 28 Dec 2023 08:53:22 +0000 (09:53 +0100)
src/utils/utf8/utf8.c

index 2d3bd89b9e6f37b88f2750e48e9affab688e1898..d5c5f07c7d6f081abd3f8e95e757d69679b55b71 100644 (file)
@@ -46,14 +46,13 @@ static const uint8_t utf8d[] = {
 };
 // clang-format on
 
-static uint32_t decode(uint32_t *state, uint32_t *codep, uint32_t byte) {
+static void decode(uint32_t *state, uint32_t *codep, uint32_t byte) {
   uint32_t type = utf8d[byte];
 
   *codep = (*state != UTF8_ACCEPT) ? (byte & 0x3fu) | (*codep << 6)
                                    : (0xff >> type) & (byte);
 
-  *state = utf8d[256 + *state * 16 + type];
-  return *state;
+  *state = utf8d[256 + (*state) * 16 + type];
 }
 
 bool utf8_valid(char const *s) {