std.c: Refactor, bring semantics closer to spec.
Small refactor replacing the pattern of verifying inputs in
safe equivalents of stdlib functions with a CHECK-like macro
which adheres to the C11 semantics of filling the destination
buffer when a constraint is not satisfied at runtime.
Semantic changes:
memcpy_s: More permissive memory ranges. Used to check that source does
not overlap with the entire destination buffer, when only the first
`count` bytes matter.
memcpy_s: Used to allow `dest==src`. Safe under our implementation in
aarch64 but not allowed under C11.
strlen_s: Should return 'strsz' if NULL character not found.
Change-Id: If483a97e6ee1c64c7f2afed9a0af1d3087da7002
diff --git a/inc/hf/std.h b/inc/hf/std.h
index be3b168..1c4458c 100644
--- a/inc/hf/std.h
+++ b/inc/hf/std.h
@@ -31,7 +31,7 @@
* Only the safer versions of these functions are exposed to reduce the chance
* of misusing the versions without bounds checking or null pointer checks.
*
- * These functions don't return errno_t as per the specification and implicity
+ * These functions don't return errno_t as per the specification and implicitly
* have a constraint handler that panics.
*/
void memset_s(void *dest, rsize_t destsz, int ch, rsize_t count);