Workaround 'potential multiplication overflow' code defect in de_win (cord)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 9 Dec 2016 21:57:39 +0000 (00:57 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 9 Dec 2016 21:57:39 +0000 (00:57 +0300)
* cord/tests/de_win.c (get_line_rect): Cast (extend) char_height to
LONG when multiplied by line (otherwise only the result of the
multiplication is extended to LONG implicitly).

cord/tests/de_win.c

index 23c1e2a..b36d864 100644 (file)
@@ -164,7 +164,7 @@ int char_height;
 
 void get_line_rect(int line, int win_width, RECT * rectp)
 {
-    rectp -> top = line * char_height;
+    rectp -> top = line * (LONG)char_height;
     rectp -> bottom = rectp->top + char_height;
     rectp -> left = 0;
     rectp -> right = win_width;