mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Use sizeof over magic numbers.
This commit is contained in:
parent
16a04bae0a
commit
53a3c5c21c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user