(main): Fix off-by-one error allocating sdbuff.

From-SVN: r8512
This commit is contained in:
Richard Kenner 1994-11-18 18:30:36 -05:00
parent 4841ba4b1d
commit ceb5bbab3e

View File

@ -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;