File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -4877,16 +4877,13 @@ helptags_one (
4877
4877
int fi ;
4878
4878
char_u * s ;
4879
4879
char_u * fname ;
4880
- int dirlen ;
4881
4880
int utf8 = MAYBE ;
4882
4881
int this_utf8 ;
4883
4882
int firstline ;
4884
4883
int mix = FALSE; /* detected mixed encodings */
4885
4884
4886
- /*
4887
- * Find all *.txt files.
4888
- */
4889
- dirlen = (int )STRLEN (dir );
4885
+ // Find all *.txt files.
4886
+ size_t dirlen = STRLEN (dir );
4890
4887
STRCPY (NameBuff , dir );
4891
4888
STRCAT (NameBuff , "/**/*" );
4892
4889
STRCAT (NameBuff , ext );
@@ -4908,7 +4905,7 @@ helptags_one (
4908
4905
*/
4909
4906
STRCPY (NameBuff , dir );
4910
4907
add_pathsep ((char * )NameBuff );
4911
- STRCAT (NameBuff , tagfname );
4908
+ STRNCAT (NameBuff , tagfname , sizeof ( NameBuff ) - dirlen - 2 );
4912
4909
fd_tags = mch_fopen ((char * )NameBuff , "w" );
4913
4910
if (fd_tags == NULL ) {
4914
4911
EMSG2 (_ ("E152: Cannot open %s for writing" ), NameBuff );
You can’t perform that action at this time.
0 commit comments