(main): Fix off-by-one error allocating sdbuff.
From-SVN: r8512
This commit is contained in:
parent
4841ba4b1d
commit
ceb5bbab3e
@ -219,7 +219,7 @@ main (argc, argv)
|
||||
for (j = 0; j < new_len; j++)
|
||||
if (nbuff[j] == '/') nbuff[j] = DIR_SEPARATOR;
|
||||
|
||||
sdbuff = malloc (search_dirs_len + new_len + 1);
|
||||
sdbuff = malloc (search_dirs_len + new_len + 2);
|
||||
strcpy (sdbuff, search_dirs);
|
||||
sdbuff[search_dirs_len] = PATH_SEPARATOR;
|
||||
sdbuff[search_dirs_len+1] = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user