# HG changeset patch # User Kim Alvefur # Date 1490222453 -3600 # Node ID 604beb13596a9f55bf4cffec0ab55991fded1f28 # Parent aca13c433e450b1f951bf66865c5e5b87532750a util.encodings: Make limit lookup table a const (from Lua f2a813ae) diff -r aca13c433e45 -r 604beb13596a util-src/encodings.c --- a/util-src/encodings.c Wed Mar 22 14:13:28 2017 +0100 +++ b/util-src/encodings.c Wed Mar 22 23:40:53 2017 +0100 @@ -173,7 +173,7 @@ * Decode one UTF-8 sequence, returning NULL if byte sequence is invalid. */ static const char *utf8_decode(const char *o, int *val) { - static unsigned int limits[] = {0xFF, 0x7F, 0x7FF, 0xFFFF}; + static const unsigned int limits[] = {0xFF, 0x7F, 0x7FF, 0xFFFF}; const unsigned char *s = (const unsigned char *)o; unsigned int c = s[0]; unsigned int res = 0; /* final result */