mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 17:58:18 +00:00
coverity/71532: STRING_OVERFLOW
This commit is contained in:
@@ -4877,16 +4877,13 @@ helptags_one (
|
|||||||
int fi;
|
int fi;
|
||||||
char_u *s;
|
char_u *s;
|
||||||
char_u *fname;
|
char_u *fname;
|
||||||
int dirlen;
|
|
||||||
int utf8 = MAYBE;
|
int utf8 = MAYBE;
|
||||||
int this_utf8;
|
int this_utf8;
|
||||||
int firstline;
|
int firstline;
|
||||||
int mix = FALSE; /* detected mixed encodings */
|
int mix = FALSE; /* detected mixed encodings */
|
||||||
|
|
||||||
/*
|
// Find all *.txt files.
|
||||||
* Find all *.txt files.
|
size_t dirlen = STRLEN(dir);
|
||||||
*/
|
|
||||||
dirlen = (int)STRLEN(dir);
|
|
||||||
STRCPY(NameBuff, dir);
|
STRCPY(NameBuff, dir);
|
||||||
STRCAT(NameBuff, "/**/*");
|
STRCAT(NameBuff, "/**/*");
|
||||||
STRCAT(NameBuff, ext);
|
STRCAT(NameBuff, ext);
|
||||||
@@ -4908,7 +4905,7 @@ helptags_one (
|
|||||||
*/
|
*/
|
||||||
STRCPY(NameBuff, dir);
|
STRCPY(NameBuff, dir);
|
||||||
add_pathsep((char *)NameBuff);
|
add_pathsep((char *)NameBuff);
|
||||||
STRCAT(NameBuff, tagfname);
|
STRNCAT(NameBuff, tagfname, sizeof(NameBuff) - dirlen - 2);
|
||||||
fd_tags = mch_fopen((char *)NameBuff, "w");
|
fd_tags = mch_fopen((char *)NameBuff, "w");
|
||||||
if (fd_tags == NULL) {
|
if (fd_tags == NULL) {
|
||||||
EMSG2(_("E152: Cannot open %s for writing"), NameBuff);
|
EMSG2(_("E152: Cannot open %s for writing"), NameBuff);
|
||||||
|
Reference in New Issue
Block a user