aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimen Endsjø <simendsjo@gmail.com>2014-03-02 19:37:37 +0100
committerThiago de Arruda <tpadilha84@gmail.com>2014-03-04 21:02:57 -0300
commitd3be9f37969c2cda2acb138af717c3e490b4a548 (patch)
tree61103628a29947c89e2b9d8c1671c969a0891f0a /src
parent34538a82f360da742ca40ea57c38ad40c99a17e7 (diff)
downloadrneovim-d3be9f37969c2cda2acb138af717c3e490b4a548.tar.gz
rneovim-d3be9f37969c2cda2acb138af717c3e490b4a548.tar.bz2
rneovim-d3be9f37969c2cda2acb138af717c3e490b4a548.zip
Assert that vim_strsize and vim_strnsize gets a non-null parameter.
Diffstat (limited to 'src')
-rw-r--r--src/charset.c5
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) {