diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-09 22:30:48 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-09 22:30:48 +0300 |
commit | 35584594f5cfd46e9a56d9bc3473244c437a944a (patch) | |
tree | 0b0e6d30832dd5fa411a24a49fc13bf00411dd1f /test/functional | |
parent | 8f75b67c0733f09b8bc1d99235eb3231abc6500c (diff) | |
download | rneovim-35584594f5cfd46e9a56d9bc3473244c437a944a.tar.gz rneovim-35584594f5cfd46e9a56d9bc3473244c437a944a.tar.bz2 rneovim-35584594f5cfd46e9a56d9bc3473244c437a944a.zip |
coverity/13689: Check file header with memcmp
Not that it is actually useful (would fail in any case), but should fix coverity
report.
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/spell/spellfile_spec.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/spell/spellfile_spec.lua b/test/functional/spell/spellfile_spec.lua index 05c2293c50..e7cd10d2ac 100644 --- a/test/functional/spell/spellfile_spec.lua +++ b/test/functional/spell/spellfile_spec.lua @@ -97,4 +97,12 @@ describe('spellfile', function() eq('Vim(set):E759: Format error in spell file', exc_exec('set spell')) end) + it('errors out when spell header contains NUL bytes', function() + meths.set_option('runtimepath', testdir) + write_file(testdir .. '/spell/en.ascii.spl', + spellheader:sub(1, -3) .. '\000\000') + meths.set_option('spelllang', 'en') + eq('Vim(set):E757: This does not look like a spell file', + exc_exec('set spell')) + end) end) |