* cygcheck.cc (find_app_on_path): Make buffer SYMLINK_MAX + 1
chars.
This commit is contained in:
parent
60efa4e546
commit
5b7296f637
@ -1,3 +1,8 @@
|
||||
2008-03-11 Brian Dessent <brian@dessent.net>
|
||||
|
||||
* cygcheck.cc (find_app_on_path): Make buffer SYMLINK_MAX + 1
|
||||
chars.
|
||||
|
||||
2008-03-11 Brian Dessent <brian@dessent.net>
|
||||
|
||||
* cygcheck.cc (dirname): New static function.
|
||||
|
@ -843,7 +843,7 @@ find_app_on_path (const char *app, bool showall = false)
|
||||
|
||||
if (is_symlink (fh))
|
||||
{
|
||||
static char tmp[SYMLINK_MAX];
|
||||
static char tmp[SYMLINK_MAX + 1];
|
||||
if (!readlink (fh, tmp, SYMLINK_MAX))
|
||||
display_error("readlink failed");
|
||||
|
||||
@ -853,9 +853,9 @@ find_app_on_path (const char *app, bool showall = false)
|
||||
if (!strchr (ptr, '\\'))
|
||||
{
|
||||
char *lastsep;
|
||||
strncpy (tmp, cygpath (papp, NULL), SYMLINK_MAX - 1);
|
||||
strncpy (tmp, cygpath (papp, NULL), SYMLINK_MAX);
|
||||
lastsep = strrchr (tmp, '\\');
|
||||
strncpy (lastsep+1, ptr, SYMLINK_MAX - 1 - (lastsep-tmp));
|
||||
strncpy (lastsep+1, ptr, SYMLINK_MAX - (lastsep-tmp));
|
||||
ptr = tmp;
|
||||
}
|
||||
if (!CloseHandle (fh))
|
||||
|
Loading…
Reference in New Issue
Block a user