From 0a0040e190e6513bb3c4b30a4731e5c12a46b06b Mon Sep 17 00:00:00 2001 From: IgorA Date: Sun, 25 Apr 2021 19:46:48 +0000 Subject: [PATCH] fix divide by 0 in function edit_box.get_n git-svn-id: svn://kolibrios.org@8681 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/libraries/box_lib/trunk/editbox.asm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/programs/develop/libraries/box_lib/trunk/editbox.asm b/programs/develop/libraries/box_lib/trunk/editbox.asm index ef5861b7ab..00052e0d4f 100644 --- a/programs/develop/libraries/box_lib/trunk/editbox.asm +++ b/programs/develop/libraries/box_lib/trunk/editbox.asm @@ -772,10 +772,16 @@ edit_box.draw_bg_eax: ;---------------------------------------------------------- ;--- процедура получения количества символов в текущей ширине компонента ;---------------------------------------------------------- +align 4 edit_box.get_n: mov eax,ed_width sub eax,4 xor edx,edx + cmp word ed_char_width,0 + jne @f + xor eax,eax + ret + @@: div word ed_char_width ret