+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.
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");
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))