From 8a1c3461bb820bf875a50be56c7652177cf50645 Mon Sep 17 00:00:00 2001 From: axtloss Date: Tue, 16 Jul 2024 02:28:06 +0200 Subject: fix formatting --- src/memset_s.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/memset_s.c') 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_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; } - -- cgit v1.2.3