util.encodings: Make limit lookup table a const (from Lua f2a813ae)
authorKim Alvefur <zash@zash.se>
Wed, 22 Mar 2017 23:40:53 +0100
changeset 8001 604beb13596a
parent 8000 aca13c433e45
child 8002 980606856882
child 8003 42dd766cfe97
util.encodings: Make limit lookup table a const (from Lua f2a813ae)
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 */