mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-patch:8.2.3574: divide by zero
Problem: Divide by zero.
Solution: Don't check for overflow if multiplicand is zero.
8a1962d135
This commit is contained in:
@@ -3434,8 +3434,9 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
|
||||
const long multlen = count * yanklen;
|
||||
|
||||
totlen = (size_t)(int)multlen;
|
||||
if (totlen != (size_t)multlen || (long)totlen / count != yanklen
|
||||
|| (long)totlen / yanklen != count) {
|
||||
if (count != 0 && yanklen != 0
|
||||
&& (totlen != (size_t)multlen || (long)totlen / count != yanklen
|
||||
|| (long)totlen / yanklen != count)) {
|
||||
emsg(_(e_resulting_text_too_long));
|
||||
break;
|
||||
} else if (totlen > 0) {
|
||||
|
Reference in New Issue
Block a user