kopia lustrzana https://gitlab.com/sane-project/backends
dll: Fix [-Wformat-truncation=] compiler warning
Per POSIX, `readdir` returns filenames that are at most `NAME_MAX` long.merge-requests/213/head
rodzic
e0d669acfe
commit
a993e6438e
|
@ -799,7 +799,8 @@ read_dlld (void)
|
||||||
DIR *dlld;
|
DIR *dlld;
|
||||||
struct dirent *dllconf;
|
struct dirent *dllconf;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char conffile[PATH_MAX], dlldir[PATH_MAX];
|
char dlldir[PATH_MAX];
|
||||||
|
char conffile[PATH_MAX + strlen("/") + NAME_MAX];
|
||||||
size_t len, plen;
|
size_t len, plen;
|
||||||
const char *dir_list;
|
const char *dir_list;
|
||||||
char *copy, *next, *dir;
|
char *copy, *next, *dir;
|
||||||
|
@ -851,7 +852,7 @@ read_dlld (void)
|
||||||
|| (dllconf->d_name[len-1] == '#'))
|
|| (dllconf->d_name[len-1] == '#'))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
snprintf (conffile, PATH_MAX, "%s/%s", dlldir, dllconf->d_name);
|
snprintf (conffile, sizeof(conffile), "%s/%s", dlldir, dllconf->d_name);
|
||||||
|
|
||||||
DBG (5, "sane_init/read_dlld: considering %s\n", conffile);
|
DBG (5, "sane_init/read_dlld: considering %s\n", conffile);
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue