`c_str() + '\0'` adds char value 0 to the pointer, which is a no-op.
The null terminator is already included by passing `length() + 1` as the
length argument to append(). Drop the spurious `+ '\0'`.
this change addresses the warning:
```
[1588/1869] Building CXX object src/test/rgw/CMakeFiles/ceph_test_rgw_d4n_policy.dir/test_d4n_policy.cc.o
/home/kefu/dev/ceph/src/test/rgw/test_d4n_policy.cc:324:39: warning: adding 'char' to a string pointer does not append to the string [-Wstring-plus-char]
324 | attrVal.append(length_str.c_str() + '\0', length_str.length() + 1);
| ~~~~~~~~~~~~~~~~~~~^~~~~~
/home/kefu/dev/ceph/src/test/rgw/test_d4n_policy.cc:324:39: note: use array indexing to silence this warning
324 | attrVal.append(length_str.c_str() + '\0', length_str.length() + 1);
| ^
| & [ ]
```
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
buffer::list attrVal;
auto length_str = std::to_string(TEST_DATA_LENGTH);
- attrVal.append(length_str.c_str() + '\0', length_str.length() + 1);
+ attrVal.append(length_str.c_str(), length_str.length() + 1);
attrs.insert({"accounted_size", std::move(attrVal)});
attrVal.clear();
attrVal.append("testBucket\0", 10);