Comparison

util-src/encodings.c @ 8291:fba1ea67f5c0

util.encodings: Use the 'idx' argument correctly [-Wunused-parameter]
author Kim Alvefur <zash@zash.se>
date Thu, 05 Oct 2017 12:48:36 +0200
parent 7998:604beb13596a
child 9153:26c5a4a14905
comparison
equal deleted inserted replaced
8289:bd6b189b354c 8291:fba1ea67f5c0
214 * Check that a string is valid UTF-8 214 * Check that a string is valid UTF-8
215 * Returns NULL if not 215 * Returns NULL if not
216 */ 216 */
217 const char *check_utf8(lua_State *L, int idx, size_t *l) { 217 const char *check_utf8(lua_State *L, int idx, size_t *l) {
218 size_t pos, len; 218 size_t pos, len;
219 const char *s = luaL_checklstring(L, 1, &len); 219 const char *s = luaL_checklstring(L, idx, &len);
220 pos = 0; 220 pos = 0;
221 221
222 while(pos <= len) { 222 while(pos <= len) {
223 const char *s1 = utf8_decode(s + pos, NULL); 223 const char *s1 = utf8_decode(s + pos, NULL);
224 224