aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2014-07-23 12:16:28 -0400
committerScott Prager <splinterofchaos@gmail.com>2014-08-17 22:16:00 -0400
commit53a3c5c21ceb0d2f5c242ae3f4ad6e2634852497 (patch)
tree1f9f170c72651f9cc70154ffc5f873717ca20a79 /src
parent16a04bae0a91e00d120b6fdd8e24b620b9859c87 (diff)
downloadrneovim-53a3c5c21ceb0d2f5c242ae3f4ad6e2634852497.tar.gz
rneovim-53a3c5c21ceb0d2f5c242ae3f4ad6e2634852497.tar.bz2
rneovim-53a3c5c21ceb0d2f5c242ae3f4ad6e2634852497.zip
Use sizeof over magic numbers.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_cmds.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 0a26026d7b..e4f646d865 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -1319,11 +1319,12 @@ make_filter_cmd (
char_u *otmp /* NULL or name of output file */
)
{
- size_t len = STRLEN(cmd) + 3; /* "()" + NUL */
+ size_t len = STRLEN(cmd) + 1; // len + NLL
+ len += sizeof("("")") - 1;
if (itmp != NULL)
- len += STRLEN(itmp) + 9; /* " { < " + " } " */
+ len += STRLEN(itmp) + sizeof(" { "" < "" } ") - 1;
if (otmp != NULL)
- len += STRLEN(otmp) + STRLEN(p_srr) + 2; /* " " */
+ len += STRLEN(otmp) + STRLEN(p_srr) + 2; // two extra spaces (" "),
char_u *buf = xmalloc(len);
#if defined(UNIX)