Refactored memcopy range check.

This commit is contained in:
skarg
2017-01-01 05:18:13 +00:00
parent 5e5dc533af
commit 98d919546c
2 changed files with 119 additions and 52 deletions
+7 -5
View File
@@ -33,14 +33,16 @@
extern "C" {
#endif /* __cplusplus */
/* copy len bytes from src to offset of dest if there is enough space. */
/* returns 0 if there is not enough space, or the number of bytes copied. */
bool memcopylen(
size_t offset,
size_t max,
size_t len);
size_t memcopy(
void *dest,
void *src,
size_t offset, /* where in dest to put the data */
size_t len, /* amount of data to copy */
size_t max); /* total size of destination */
size_t offset,
size_t len,
size_t max);
#ifdef __cplusplus
}