libini: abort infinite loop on write error

git-svn-id: svn://kolibrios.org@1568 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2010-08-15 21:41:43 +00:00
parent baf8ec007b
commit 5990ba6772
2 changed files with 9 additions and 6 deletions

View File

@ -396,7 +396,7 @@ import libgfx, \
gfx.open ,'gfx_open',\ gfx.open ,'gfx_open',\
gfx.close ,'gfx_close',\ gfx.close ,'gfx_close',\
gfx.pen.color ,'gfx_pen_color',\ gfx.pen.color ,'gfx_pen_color',\
gfx.brush.color ,'gfx_brush.color',\ gfx.brush.color ,'gfx_brush_color',\
gfx.pixel ,'gfx_pixel',\ gfx.pixel ,'gfx_pixel',\
gfx.move.to ,'gfx_move_to',\ gfx.move.to ,'gfx_move_to',\
gfx.line.to ,'gfx_line_to',\ gfx.line.to ,'gfx_line_to',\

View File

@ -278,8 +278,15 @@ endl
neg eax neg eax
sub eax, ecx sub eax, ecx
invoke file.seek, ebx, eax, SEEK_CUR invoke file.seek, ebx, eax, SEEK_CUR
push ecx
invoke file.write, ebx, [buf], ecx invoke file.write, ebx, [buf], ecx
jmp @b pop ecx
cmp eax, ecx
jz @b
.fail:
or eax, -1
pop ecx ebx
ret
.done: .done:
mov eax, [_delta] mov eax, [_delta]
neg eax neg eax
@ -290,10 +297,6 @@ endl
pop ecx ebx pop ecx ebx
.skip: .skip:
ret ret
.fail:
or eax, -1
pop ecx ebx
ret
.down: .down:
neg [_delta] neg [_delta]