]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/../chain_xattr.cc: fix suspicious usage of 'sizeof'
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 17 Mar 2015 16:55:06 +0000 (17:55 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 15 Apr 2015 10:21:15 +0000 (12:21 +0200)
Use sizeof(char) instead of sizeof('\0').

Fix for:

[src/test/objectstore/chain_xattr.cc:164]: (warning) Suspicious
 usage of 'sizeof' with a numeric constant as parameter.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/test/objectstore/chain_xattr.cc

index 7e2e69371292f51c04a184f3e88c430e253c973d..5c77b9520da24a87d0fe6ae6e6e694596592d280 100644 (file)
@@ -161,7 +161,7 @@ TEST(chain_xattr, listxattr) {
   ASSERT_EQ(LARGE_BLOCK_LEN, chain_setxattr(file, name1.c_str(), x.c_str(), LARGE_BLOCK_LEN));
   ASSERT_EQ((int)sizeof(y), chain_setxattr(file, name2.c_str(), &y, sizeof(y)));
 
-  int buffer_size = name1.size() + sizeof('\0') + name2.size() + sizeof('\0');
+  int buffer_size = name1.size() + sizeof(char) + name2.size() + sizeof(char);
   char* expected = (char*)malloc(buffer_size);
   ::strcpy(expected, name1.c_str());
   ::strcpy(expected + name1.size() + 1, name2.c_str());