Skip to content
Snippets Groups Projects
Commit 454a05f0 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

glob() paranoia

Make Coverity happy.
parent c0373038
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1328 passed
...@@ -2326,12 +2326,12 @@ str_list_t iniReadFile(FILE* fp) ...@@ -2326,12 +2326,12 @@ str_list_t iniReadFile(FILE* fp)
inc_len=strlen(INI_INCLUDE_DIRECTIVE); inc_len=strlen(INI_INCLUDE_DIRECTIVE);
for(i=0; list[i]!=NULL; i++) { for(i=0; list[i]!=NULL; i++) {
if(strnicmp(list[i],INI_INCLUDE_DIRECTIVE,inc_len)==0) { if(strnicmp(list[i],INI_INCLUDE_DIRECTIVE,inc_len)==0) {
glob_t gl; glob_t gl = {0};
size_t j; size_t j;
p=list[i]+inc_len; p=list[i]+inc_len;
SKIP_WHITESPACE(p); SKIP_WHITESPACE(p);
truncsp(p); truncsp(p);
glob(p, GLOB_MARK, NULL, &gl); (void)glob(p, GLOB_MARK, NULL, &gl);
safe_snprintf(str, sizeof(str), "; %s - %lu matches found", list[i], (ulong)gl.gl_pathc); safe_snprintf(str, sizeof(str), "; %s - %lu matches found", list[i], (ulong)gl.gl_pathc);
strListReplace(list, i, str); strListReplace(list, i, str);
for(j = 0; j < gl.gl_pathc; j++) { for(j = 0; j < gl.gl_pathc; j++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment