Use sizeof over magic numbers.

This commit is contained in:
Scott Prager 2014-07-23 12:16:28 -04:00
parent 16a04bae0a
commit 53a3c5c21c

View File

@ -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)