mirror of
https://github.com/lunarmodules/lua-iconv.git
synced 2025-06-23 04:34:33 +02:00
*** empty log message ***
git-svn-id: file:///var/svn/lua-iconv/trunk@9 9538949d-8f27-0410-946f-ce01ef448559
This commit is contained in:
parent
a226dc348c
commit
c03c381b14
12
luaiconv.c
12
luaiconv.c
@ -104,13 +104,14 @@ static int Liconv(lua_State *L)
|
||||
size_t ret = -1;
|
||||
|
||||
outbuf = (char*) malloc(ibleft * sizeof(char));
|
||||
outbufs = outbuf;
|
||||
if(outbuf == NULL)
|
||||
{
|
||||
lua_pushstring(L, "");
|
||||
lua_pushnumber(L, ERROR_NO_MEMORY);
|
||||
return 2;
|
||||
}
|
||||
outbufs = outbuf;
|
||||
printf("M ibleft=%d, bsize=%d, obleft=%d\n", ibleft, bsize, obleft);
|
||||
|
||||
do
|
||||
{
|
||||
@ -135,8 +136,15 @@ static int Liconv(lua_State *L)
|
||||
{
|
||||
bsize += 2 * ibleft;
|
||||
obleft += 2 * ibleft;
|
||||
printf("R ibleft=%d, bsize=%d, obleft=%d\n", ibleft, bsize,
|
||||
obleft);
|
||||
outbufs = (char*) realloc(outbufs, bsize * sizeof(char));
|
||||
puts("REALOQUEI");
|
||||
if(outbufs == NULL)
|
||||
{
|
||||
lua_pushstring(L, "");
|
||||
lua_pushnumber(L, ERROR_NO_MEMORY);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user