From 2dab2f0f73160bafcaa3aa4cce7dcccc1ddcb3ba Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 9 Nov 2014 12:50:53 +0000 Subject: registry: Slightly simplify tdb_data_is_cstr Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/registry/reg_backend_db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 67beb6a8d37..44a3d9fd356 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -547,7 +547,7 @@ static bool tdb_data_is_cstr(TDB_DATA d) { if (tdb_data_is_empty(d) || (d.dptr[d.dsize-1] != '\0')) { return false; } - return strchr((char *)d.dptr, '\0') == (char *)&d.dptr[d.dsize-1]; + return strlen((char *)d.dptr) == (d.dsize-1); } static bool upgrade_v2_to_v3_check_subkeylist(struct db_context *db, -- cgit v1.2.1