1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Fix 'void*' arithmetic warnings in dbg_malloc.c.

Use more readable char[idx] access instead of *char+idx access.
This commit is contained in:
Zdenek Kabelac 2010-08-03 13:24:07 +00:00
parent 30168792f4
commit 59f8043d7c
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.73 -
================================
Fix 'void*' arithmetic warnings in dbg_malloc.c.
Fix 'void*' arithmetic warning in some functions from libdm-iface.c.
Fix const warning in dev_manager_info() and _dev_manager_lv_rmnodes().
Fix const warning in archive_file structure from archive.c.

View File

@ -196,12 +196,12 @@ int dm_dump_memory_debug(void)
for (c = 0; c < sizeof(str) - 1; c++) {
if (c >= mb->length)
str[c] = ' ';
else if (*(char *)(mb->magic + c) == '\0')
else if (((char *)mb->magic)[c] == '\0')
str[c] = '\0';
else if (*(char *)(mb->magic + c) < ' ')
else if (((char *)mb->magic)[c] < ' ')
str[c] = '?';
else
str[c] = *(char *)(mb->magic + c);
str[c] = ((char *)mb->magic)[c];
}
str[sizeof(str) - 1] = '\0';