mirror of
https://github.com/lunarmodules/lua-iconv.git
synced 2025-06-22 20:24:36 +02:00
Fix invalid error report
cd:iconv returned an invalid ERROR_UNKNOW code instead of 'nil' on successful conversions. This usually passes unnoticed since the return string is what the user actually expects.
This commit is contained in:
parent
1876a6de19
commit
6f265ded5d
@ -147,13 +147,14 @@ static int Liconv(lua_State *L) {
|
||||
return 2; /* Unknown error */
|
||||
}
|
||||
}
|
||||
} while (ret != (size_t) 0);
|
||||
} while (ret == (size_t) -1);
|
||||
|
||||
lua_pushlstring(L, outbufs, obsize - obleft);
|
||||
if (hasone == 1)
|
||||
lua_concat(L, 2);
|
||||
free(outbufs);
|
||||
return 1; /* Done */
|
||||
lua_pushnil(L);
|
||||
return 2; /* Done */
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user