diff options
author | Simen Endsjø <simendsjo@gmail.com> | 2014-03-02 19:37:37 +0100 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-03-04 21:02:57 -0300 |
commit | d3be9f37969c2cda2acb138af717c3e490b4a548 (patch) | |
tree | 61103628a29947c89e2b9d8c1671c969a0891f0a | |
parent | 34538a82f360da742ca40ea57c38ad40c99a17e7 (diff) | |
download | rneovim-d3be9f37969c2cda2acb138af717c3e490b4a548.tar.gz rneovim-d3be9f37969c2cda2acb138af717c3e490b4a548.tar.bz2 rneovim-d3be9f37969c2cda2acb138af717c3e490b4a548.zip |
Assert that vim_strsize and vim_strnsize gets a non-null parameter.
-rw-r--r-- | src/charset.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/charset.c b/src/charset.c index ad84f09874..3f609801a2 100644 --- a/src/charset.c +++ b/src/charset.c @@ -600,6 +600,8 @@ int ptr2cells(char_u *p) /* * Return the number of character cells string "s" will take on the screen, * counting TABs as two characters: "^I". + * + * 's' must be non-null. */ int vim_strsize(char_u *s) { @@ -609,9 +611,12 @@ int vim_strsize(char_u *s) /* * Return the number of character cells string "s[len]" will take on the * screen, counting TABs as two characters: "^I". + * + * 's' must be non-null. */ int vim_strnsize(char_u *s, int len) { + assert(s); int size = 0; while (*s != NUL && --len >= 0) { |