mirror of
https://github.com/ceph/ceph
synced 2025-01-18 09:02:08 +00:00
test_librbd.cc: fix sizeof() in malloc call
Use 'char' instead of 'char *'. 228 names = (char *) malloc(sizeof(char *) * 1024); Result of 'malloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'char *' Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
parent
eb2def87f8
commit
fe75075574
@ -225,7 +225,7 @@ int test_ls(rados_ioctx_t io_ctx, size_t num_expected, ...)
|
||||
va_list ap;
|
||||
size_t max_size = 1024;
|
||||
|
||||
names = (char *) malloc(sizeof(char *) * 1024);
|
||||
names = (char *) malloc(sizeof(char) * 1024);
|
||||
int len = rbd_list(io_ctx, names, &max_size);
|
||||
|
||||
for (i = 0, num_images = 0, cur_name = names; cur_name < names + len; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user