copy only FS_MAX_PATH-1

This commit is contained in:
Dave Murphy 2018-05-08 18:35:45 +01:00
parent 0865c8c9b0
commit 213dde3613

View File

@ -242,7 +242,7 @@ fsdev_getfspath(struct _reent *r,
return -1; return -1;
memset(outpath, 0, FS_MAX_PATH); memset(outpath, 0, FS_MAX_PATH);
memcpy(outpath, __fixedpath,FS_MAX_PATH); memcpy(outpath, __fixedpath,FS_MAX_PATH-1);
outpath[FS_MAX_PATH-1] = '\0'; outpath[FS_MAX_PATH-1] = '\0';
return 0; return 0;