Diff

util-src/encodings.c @ 7998:604beb13596a

util.encodings: Make limit lookup table a const (from Lua f2a813ae)
author Kim Alvefur <zash@zash.se>
date Wed, 22 Mar 2017 23:40:53 +0100
parent 7889:b8d694646597
child 8291:fba1ea67f5c0
line wrap: on
line diff
--- 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 */