diff options
author | axtloss <axtlos@getcryst.al> | 2024-07-16 02:28:06 +0200 |
---|---|---|
committer | axtloss <axtlos@getcryst.al> | 2024-07-16 02:28:06 +0200 |
commit | 8a1c3461bb820bf875a50be56c7652177cf50645 (patch) | |
tree | b79b103693dc01f0f5b0b993e9f9fcf972d67977 /src/memset_s.c | |
parent | 0366952bae967a1b69c510f8e633c0567ccab4a9 (diff) | |
download | extlib-8a1c3461bb820bf875a50be56c7652177cf50645.tar.gz extlib-8a1c3461bb820bf875a50be56c7652177cf50645.tar.bz2 |
fix formatting
Diffstat (limited to 'src/memset_s.c')
-rw-r--r-- | src/memset_s.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/memset_s.c b/src/memset_s.c index 8b4d342..74c0025 100644 --- a/src/memset_s.c +++ b/src/memset_s.c @@ -7,25 +7,25 @@ #include <errno.h> errno_t -memset_s(void *s, rsize_t smax, int c, rsize_t n) +memset_s (void *s, rsize_t smax, int c, rsize_t n) { - volatile unsigned char *dest = (unsigned char *) s; - errno_t ret = EINVAL; - rsize_t limit = n < smax ? n : smax; + volatile unsigned char *dest = (unsigned char *) s; + errno_t ret = EINVAL; + rsize_t limit = n < smax ? n : smax; - if (!s) - throw_constraint_handler_s("memset_s: s = NULL", ret); - else if (n > RSIZE_MAX) - throw_constraint_handler_s("memset_s: n > RSIZE_MAX", ret); - else if (smax > RSIZE_MAX) - throw_constraint_handler_s("memset_s: smax > RSIZE_MAX", ret); - else if (n > smax) - throw_constraint_handler_s("memset_s: n > smax", ret); - else { - while (limit > 0) - dest[--limit] = (unsigned char)c; - ret = 0; - } - return ret; + if (!s) + throw_constraint_handler_s ("memset_s: s = NULL", ret); + else if (n > RSIZE_MAX) + throw_constraint_handler_s ("memset_s: n > RSIZE_MAX", ret); + else if (smax > RSIZE_MAX) + throw_constraint_handler_s ("memset_s: smax > RSIZE_MAX", ret); + else if (n > smax) + throw_constraint_handler_s ("memset_s: n > smax", ret); + else + { + while (limit > 0) + dest[--limit] = (unsigned char) c; + ret = 0; + } + return ret; } - |