*** empty log message ***

git-svn-id: file:///var/svn/lua-iconv/trunk@9 9538949d-8f27-0410-946f-ce01ef448559
This commit is contained in:
Alexandre Erwin Ittner 2005-07-06 01:24:54 +00:00
parent a226dc348c
commit c03c381b14

View File

@ -104,13 +104,14 @@ static int Liconv(lua_State *L)
size_t ret = -1; size_t ret = -1;
outbuf = (char*) malloc(ibleft * sizeof(char)); outbuf = (char*) malloc(ibleft * sizeof(char));
outbufs = outbuf;
if(outbuf == NULL) if(outbuf == NULL)
{ {
lua_pushstring(L, ""); lua_pushstring(L, "");
lua_pushnumber(L, ERROR_NO_MEMORY); lua_pushnumber(L, ERROR_NO_MEMORY);
return 2; return 2;
} }
outbufs = outbuf;
printf("M ibleft=%d, bsize=%d, obleft=%d\n", ibleft, bsize, obleft);
do do
{ {
@ -135,8 +136,15 @@ static int Liconv(lua_State *L)
{ {
bsize += 2 * ibleft; bsize += 2 * ibleft;
obleft += 2 * ibleft; obleft += 2 * ibleft;
printf("R ibleft=%d, bsize=%d, obleft=%d\n", ibleft, bsize,
obleft);
outbufs = (char*) realloc(outbufs, bsize * sizeof(char)); outbufs = (char*) realloc(outbufs, bsize * sizeof(char));
puts("REALOQUEI"); if(outbufs == NULL)
{
lua_pushstring(L, "");
lua_pushnumber(L, ERROR_NO_MEMORY);
return 2;
}
} }
else else
{ {