settings: coverity - possible buf overflow

This commit is contained in:
Jaroslav Kysela 2014-10-03 16:58:39 +02:00
parent b2913639c4
commit bc1d444ed9

View file

@ -502,7 +502,8 @@ makedirs ( const char *inpath, int mode )
x = 1;
ok = 1;
strcpy(path, inpath);
strncpy(path, inpath, sizeof(path)-1);
path[sizeof(path)-1] = '\0';
while(ok) {
ok = path[x];
if (path[x] == '/' || !path[x]) {