charset: Avoid overflow in vim_str2nr

This commit is contained in:
ZyX
2017-10-16 00:07:32 +03:00
parent 2cb95bd937
commit 1a3635304b
4 changed files with 53 additions and 80 deletions

View File

@@ -6867,13 +6867,19 @@ describe('Expressions parser', function()
},
}, {
})
check_parsing('0', 0, {
-- 0
check_parsing({data='01', size=1}, 0, {
ast = {
'Integer(val=0):0:0:0',
},
}, {
hl('Number', '0'),
})
check_parsing({data='001', size=2}, 0, {
ast = {
'Integer(val=0):0:0:00',
},
}, {
hl('Number', '00'),
})
end)
end)