aboutsummaryrefslogtreecommitdiffstats
path: root/jnlib/stringhelp.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2006-10-19 14:22:06 +0000
committerWerner Koch <[email protected]>2006-10-19 14:22:06 +0000
commitdf52700f5c694a9cd5fa2f10b2c3633aee9343a9 (patch)
tree70a78d2e1def01b7b550767f819d74a22eb4db23 /jnlib/stringhelp.c
parentPreparing a release (diff)
downloadgnupg-df52700f5c694a9cd5fa2f10b2c3633aee9343a9.tar.gz
gnupg-df52700f5c694a9cd5fa2f10b2c3633aee9343a9.zip
Fixes
Diffstat (limited to '')
-rw-r--r--jnlib/stringhelp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/jnlib/stringhelp.c b/jnlib/stringhelp.c
index 4e2768251..1731dd946 100644
--- a/jnlib/stringhelp.c
+++ b/jnlib/stringhelp.c
@@ -796,3 +796,15 @@ memicmp( const char *a, const char *b, size_t n )
#endif
+#ifndef HAVE_MEMRCHR
+void *
+memrchr (const void *buffer, int c, size_t n)
+{
+ const unsigned char *p = buffer;
+
+ for (p += n; n ; n--)
+ if (*--p == c)
+ return p;
+ return NULL;
+}
+#endif /*HAVE_MEMRCHR*/