summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-12-06 01:05:39 +0100
committerMichael Adam <obnox@samba.org>2011-12-06 10:45:43 +0100
commit958e4f51d2857e1f84acf770ab0d9f2cee5d5d83 (patch)
tree82cdb678e533b2d690595cc05227b552cd9c8cb6 /source3
parent2a69de6fde68d6e865e901beb7c65e6f4f16f0f8 (diff)
downloadsamba-958e4f51d2857e1f84acf770ab0d9f2cee5d5d83.tar.gz
samba-958e4f51d2857e1f84acf770ab0d9f2cee5d5d83.tar.bz2
samba-958e4f51d2857e1f84acf770ab0d9f2cee5d5d83.zip
Revert "Remove rawmemchr calls - found by Ira Cooper. These are glibc-specific calls, makes us completely non-portable."
This reverts commit 82b1702284ba2bb61b23e1f14ce9145d896c36c0. This is not functionally equivalent, needs to be done differently.
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net_registry_check.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c
index 9dca2192b6..98f17f506e 100644
--- a/source3/utils/net_registry_check.c
+++ b/source3/utils/net_registry_check.c
@@ -208,10 +208,10 @@ static bool tdb_data_read_regval(TDB_DATA *buf, struct regval *result)
}
static bool tdb_data_is_cstr(TDB_DATA d) {
- if (tdb_data_is_empty(d)) {
+ if (tdb_data_is_empty(d) || (d.dptr[d.dsize-1] != '\0')) {
return false;
}
- return (d.dptr[d.dsize-1] == '\0');
+ return rawmemchr(d.dptr, '\0') == &d.dptr[d.dsize-1];
}
static char* tdb_data_print(TALLOC_CTX *mem_ctx, TDB_DATA d)
@@ -664,8 +664,7 @@ static bool srprs_path(const char **ptr, const char* prefix, char sep,
return false;
}
*ppath = path;
- /* We know pos ends in '\0'. */
- *ptr = &pos[strlen(pos)];
+ *ptr = rawmemchr(pos, '\0');
return true;
}