fix divide by 0 in function edit_box.get_n

git-svn-id: svn://kolibrios.org@8681 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2021-04-25 19:46:48 +00:00
parent 7f4ba4d3e1
commit 0a0040e190

View File

@ -772,10 +772,16 @@ edit_box.draw_bg_eax:
;---------------------------------------------------------- ;----------------------------------------------------------
;--- ¯à®æ¥¤ãà  ¯®«ã祭¨ï ª®«¨ç¥á⢠ ᨬ¢®«®¢ ¢ ⥪ã饩 è¨à¨­¥ ª®¬¯®­¥­â  ;--- ¯à®æ¥¤ãà  ¯®«ã祭¨ï ª®«¨ç¥á⢠ ᨬ¢®«®¢ ¢ ⥪ã饩 è¨à¨­¥ ª®¬¯®­¥­â 
;---------------------------------------------------------- ;----------------------------------------------------------
align 4
edit_box.get_n: edit_box.get_n:
mov eax,ed_width mov eax,ed_width
sub eax,4 sub eax,4
xor edx,edx xor edx,edx
cmp word ed_char_width,0
jne @f
xor eax,eax
ret
@@:
div word ed_char_width div word ed_char_width
ret ret