summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-02-04 01:40:48 +0100
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-02-04 01:40:48 +0100
commitcfae8759b9db9198596d7377e4531e4ba7acc0f8 (patch)
tree3a3484c248eb3ecb25a9b6763c11a1db3c049056
parentf068bb04a92418c97e0da79699cd52ee230566ac (diff)
downloadlog-cfae8759b9db9198596d7377e4531e4ba7acc0f8.tar.gz
log-cfae8759b9db9198596d7377e4531e4ba7acc0f8.zip
Update to libstr
-rw-r--r--src/log.c46
1 files changed, 1 insertions, 45 deletions
diff --git a/src/log.c b/src/log.c
index 7b03550..85f94c9 100644
--- a/src/log.c
+++ b/src/log.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+#include <string2.h>
#include <time.h>
#include "log.h"
@@ -57,50 +57,6 @@ log_parse_level_property(char *str_level)
}
static int
-strends(const char *str1, const char *str2)
-{
- int str1_s = strlen(str1);
- int str2_s = strlen(str2);
- int i, offset;
-
- if (str1_s < str2_s) {
- /* str2 is longer than str1, so str1 doesn't contain str2 */
- return 1;
- }
-
- offset = str1_s - str2_s;
-
- for (i = str1_s - 1; i <= offset; i++) {
- if (str1[i] != str2[i - offset]) {
- return 1;
- }
- }
-
- return 0;
-}
-
-static int
-strstarts(const char *str1, const char *str2)
-{
- int str1_s = strlen(str1);
- int str2_s = strlen(str2);
- int i;
-
- if (str1_s < str2_s) {
- /* str2 is longer than str1, so str1 doesn't contain str2 */
- return 1;
- }
-
- for (i = 0; i < str2_s; i++) {
- if (str1[i] != str2[i]) {
- return 1;
- }
- }
-
- return 0;
-}
-
-static int
stridxof(const char *str, char c)
{
int size_s = strlen(str);