aboutsummaryrefslogtreecommitdiff
path: root/src/lib/strings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/strings.c')
-rw-r--r--src/lib/strings.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/strings.c b/src/lib/strings.c
index 795caa2..94b315f 100644
--- a/src/lib/strings.c
+++ b/src/lib/strings.c
@@ -1,6 +1,7 @@
#include "../lib/strings.h"
-unsigned long strlen(string_t s) {
+unsigned long strlen(string_t s)
+{
unsigned long len = 0;
while (s[len] != 0) {
len += 1;
@@ -8,7 +9,8 @@ unsigned long strlen(string_t s) {
return len;
}
-unsigned char strcmp(string_t a, string_t b) {
+unsigned char strcmp(string_t a, string_t b)
+{
unsigned long idx = 0;
while (a[idx] != 0 && b[idx] != 0) {
if (a[idx] != b[idx]) {
@@ -19,7 +21,8 @@ unsigned char strcmp(string_t a, string_t b) {
return a[idx] == b[idx];
}
-unsigned char strcmpn(string_t a, string_t b, unsigned int n) {
+unsigned char strcmpn(string_t a, string_t b, unsigned int n)
+{
unsigned long idx = 0;
while (a[idx] != 0 && b[idx] != 0 && idx+1 < n) {
if (a[idx] != b[idx]) {