summaryrefslogtreecommitdiffstats
path: root/common/mbox-util.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 21:21:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 21:21:03 +0000
commit3675f65888fde5fddde20ff811638a338bf08ca6 (patch)
tree065688bbb6355a8a4784ec9c8e112cec342eac5e /common/mbox-util.c
parentAdding upstream version 2.2.40. (diff)
downloadgnupg2-upstream.tar.xz
gnupg2-upstream.zip
Adding upstream version 2.2.43.upstream/2.2.43upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'common/mbox-util.c')
-rw-r--r--common/mbox-util.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/common/mbox-util.c b/common/mbox-util.c
index 76255ba..66f98ae 100644
--- a/common/mbox-util.c
+++ b/common/mbox-util.c
@@ -57,35 +57,6 @@ mem_count_chr (const void *buffer, int c, size_t length)
}
-/* This is a case-sensitive version of our memistr. I wonder why no
- standard function memstr exists but I better do not use the name
- memstr to avoid future conflicts. */
-static const char *
-my_memstr (const void *buffer, size_t buflen, const char *sub)
-{
- const unsigned char *buf = buffer;
- const unsigned char *t = (const unsigned char *)buf;
- const unsigned char *s = (const unsigned char *)sub;
- size_t n = buflen;
-
- for ( ; n ; t++, n-- )
- {
- if (*t == *s)
- {
- for (buf = t++, buflen = n--, s++; n && *t ==*s; t++, s++, n--)
- ;
- if (!*s)
- return (const char*)buf;
- t = (const unsigned char *)buf;
- s = (const unsigned char *)sub ;
- n = buflen;
- }
- }
- return NULL;
-}
-
-
-
static int
string_has_ctrl_or_space (const char *string)
{
@@ -159,7 +130,7 @@ is_valid_mailbox_mem (const void *name_arg, size_t namelen)
|| *name == '@'
|| name[namelen-1] == '@'
|| name[namelen-1] == '.'
- || my_memstr (name, namelen, ".."));
+ || gnupg_memstr (name, namelen, ".."));
}