]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
gencache: Avoid counting characters manually
authorVolker Lendecke <vl@samba.org>
Mon, 8 Oct 2018 07:07:59 +0000 (09:07 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 17 Oct 2018 17:22:19 +0000 (19:22 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/gencache.c

index 787ef981ec0f9cc9965d7ad35bb07b10c2cf20d7..8919a1657455de9606058a376e16835e516d5f34 100644 (file)
@@ -127,10 +127,12 @@ static bool gencache_init(void)
 
 static TDB_DATA last_stabilize_key(void)
 {
-       TDB_DATA result;
-       result.dptr = discard_const_p(uint8_t, "@LAST_STABILIZED");
-       result.dsize = 17;
-       return result;
+       const char key[] = "@LAST_STABILIZED";
+
+       return (TDB_DATA) {
+               .dptr = discard_const_p(uint8_t, key),
+               .dsize = sizeof(key),
+       };
 }
 
 struct gencache_have_val_state {