summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 36ee20d)
raw | patch | inline | side by side (parent: 36ee20d)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 23 Apr 2016 08:25:40 +0000 (10:25 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 23 Apr 2016 08:25:40 +0000 (10:25 +0200) |
Found with cppcheck
src/daemon/common.c | patch | blob | history | |
src/daemon/common.h | patch | blob | history |
diff --git a/src/daemon/common.c b/src/daemon/common.c
index 7b7353d96685d60b8bbe8fd951fb35f6e67b13cb..aedf8b27ccfe1c090bea8d6dd80323666376edac 100644 (file)
--- a/src/daemon/common.c
+++ b/src/daemon/common.c
return ((int) strlen (buffer));
}
-int strsubstitute (char *str, char c_from, char c_to)
-{
- int ret;
-
- if (str == NULL)
- return (-1);
-
- ret = 0;
- while (*str != '\0')
- {
- if (*str == c_from)
- {
- *str = c_to;
- ret++;
- }
- str++;
- }
-
- return (ret);
-} /* int strsubstitute */
-
int escape_string (char *buffer, size_t buffer_size)
{
char *temp;
diff --git a/src/daemon/common.h b/src/daemon/common.h
index c3f7f5485cb5888ed7a95634e538ff9c35b82d46..7b4eb3abfd53bf10a7b4fced80f1c017802f07ed 100644 (file)
--- a/src/daemon/common.h
+++ b/src/daemon/common.h
*/
void replace_special (char *buffer, size_t buffer_size);
-int strsubstitute (char *str, char c_from, char c_to);
-
/*
* NAME
* strunescape