mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
Use sizeof over magic numbers.
This commit is contained in:
@@ -1319,11 +1319,12 @@ make_filter_cmd (
|
|||||||
char_u *otmp /* NULL or name of output file */
|
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)
|
if (itmp != NULL)
|
||||||
len += STRLEN(itmp) + 9; /* " { < " + " } " */
|
len += STRLEN(itmp) + sizeof(" { "" < "" } ") - 1;
|
||||||
if (otmp != NULL)
|
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);
|
char_u *buf = xmalloc(len);
|
||||||
|
|
||||||
#if defined(UNIX)
|
#if defined(UNIX)
|
||||||
|
Reference in New Issue
Block a user