Silence splint somewhat

The only real changes are some unitialized variables and that we now
make explicit that we don't care about the return value from memset().
This commit is contained in:
Michael Cardell Widerkrantz 2024-03-21 12:32:08 +01:00 committed by dehanj
parent b0efcf019e
commit 09c1f3f549
No known key found for this signature in database
GPG key ID: 3707A9DBF4BB8F1A
5 changed files with 22 additions and 4 deletions

View file

@ -104,6 +104,7 @@ void *memset(void *dest, int c, unsigned n)
for (; n; n--, s++)
*s = (uint8_t)c;
/*@ -temptrans @*/
return dest;
}
@ -117,6 +118,11 @@ void memcpy_s(void *dest, size_t destsize, const void *src, size_t n)
uint8_t *dest_byte = (uint8_t *)dest;
for (size_t i = 0; i < n; i++) {
/*@ -nullderef @*/
/* splint complains that dest_byte and src_byte can be
* NULL, but it seems it doesn't understand assert.
* See above.
*/
dest_byte[i] = src_byte[i];
}
}