summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-11-18 13:13:02 -0800
committerJeremy Allison <jra@samba.org>2011-11-18 23:50:50 +0100
commit82b1702284ba2bb61b23e1f14ce9145d896c36c0 (patch)
tree9a16c4a4f793943878083a58c59923804e9d4eca
parent1d471ee393b0a0c1f9cc4256217acabcd98a5dbf (diff)
downloadsamba-82b1702284ba2bb61b23e1f14ce9145d896c36c0.tar.gz
samba-82b1702284ba2bb61b23e1f14ce9145d896c36c0.tar.bz2
samba-82b1702284ba2bb61b23e1f14ce9145d896c36c0.zip
Remove rawmemchr calls - found by Ira Cooper. These are glibc-specific calls, makes us completely non-portable.
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Nov 18 23:50:50 CET 2011 on sn-devel-104
-rw-r--r--source3/utils/net_registry_check.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c
index 22d18a68af..0936aea3b4 100644
--- a/source3/utils/net_registry_check.c
+++ b/source3/utils/net_registry_check.c
@@ -212,10 +212,10 @@ static bool tdb_data_is_empty(TDB_DATA d) {
}
static bool tdb_data_is_cstr(TDB_DATA d) {
- if (tdb_data_is_empty(d) || (d.dptr[d.dsize-1] != '\0')) {
+ if (tdb_data_is_empty(d)) {
return false;
}
- return rawmemchr(d.dptr, '\0') == &d.dptr[d.dsize-1];
+ return (d.dptr[d.dsize-1] == '\0');
}
static char* tdb_data_print(TALLOC_CTX *mem_ctx, TDB_DATA d)
@@ -668,7 +668,8 @@ static bool srprs_path(const char **ptr, const char* prefix, char sep,
return false;
}
*ppath = path;
- *ptr = rawmemchr(pos, '\0');
+ /* We know pos ends in '\0'. */
+ *ptr = &pos[strlen(pos)];
return true;
}