Properly calculate remaining length of path.

This commit is contained in:
Michael Jumper 2013-09-09 15:46:16 -07:00
parent 34586265da
commit cf3196d8ca

View File

@ -413,7 +413,7 @@ int guac_rdpdr_fs_convert_path(const char* parent, const char* rel_path, char* a
*(current++) = '\\'; *(current++) = '\\';
/* Copy remaining path */ /* Copy remaining path */
strncpy(current, rel_path, GUAC_RDPDR_FS_MAX_PATH-i); strncpy(current, rel_path, GUAC_RDPDR_FS_MAX_PATH-i-2);
/* Normalize into provided buffer */ /* Normalize into provided buffer */
return guac_rdpdr_fs_normalize_path(combined_path, abs_path); return guac_rdpdr_fs_normalize_path(combined_path, abs_path);