aboutsummaryrefslogtreecommitdiffstats
path: root/util-src
diff options
context:
space:
mode:
Diffstat (limited to 'util-src')
-rw-r--r--util-src/encodings.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/util-src/encodings.c b/util-src/encodings.c
index 4fe83c64..367182b6 100644
--- a/util-src/encodings.c
+++ b/util-src/encodings.c
@@ -283,12 +283,7 @@ static int icu_stringprep_prep(lua_State *L, const UStringPrepProfile *profile)
UErrorCode err = U_ZERO_ERROR;
- if(!lua_isstring(L, 1)) {
- lua_pushnil(L);
- return 1;
- }
-
- input = lua_tolstring(L, 1, &input_len);
+ input = luaL_checklstring(L, 1, &input_len);
if(input_len >= 1024) {
lua_pushnil(L);
@@ -408,11 +403,6 @@ static int stringprep_prep(lua_State *L, const Stringprep_profile *profile) {
int ret;
Stringprep_profile_flags flags = 0;
- if(!lua_isstring(L, 1)) {
- lua_pushnil(L);
- return 1;
- }
-
s = check_utf8(L, 1, &len);
/* strict */