style: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
diff --git a/lib/libc/minimal/source/string/string.c b/lib/libc/minimal/source/string/string.c
index a974227..8fcd271 100644
--- a/lib/libc/minimal/source/string/string.c
+++ b/lib/libc/minimal/source/string/string.c
@@ -68,8 +68,9 @@
{
char tmp = (char) c;
- while ((*s != tmp) && (*s != '\0'))
+ while ((*s != tmp) && (*s != '\0')) {
s++;
+ }
return (*s == tmp) ? (char *) s : NULL;
}
@@ -180,8 +181,9 @@
const char *c1 = m1;
const char *c2 = m2;
- if (!n)
+ if (!n) {
return 0;
+ }
while ((--n > 0) && (*c1 == *c2)) {
c1++;
diff --git a/lib/libc/minimal/source/string/strstr.c b/lib/libc/minimal/source/string/strstr.c
index 7334893..7de678f 100644
--- a/lib/libc/minimal/source/string/strstr.c
+++ b/lib/libc/minimal/source/string/strstr.c
@@ -51,8 +51,9 @@
do {
do {
sc = *s++;
- if (sc == 0)
- return NULL;
+ if (sc == 0) {
+ return NULL;
+ }
} while (sc != c);
} while (strncmp(s, find, len) != 0);
s--;