mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 14:42:29 +01:00
wrlib: potentially incorrect sizeof in malloc
Result of 'malloc' is converted to a pointer of type 'unsigned char', which is incompatible with sizeof operand type 'char' Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
This commit is contained in:
committed by
Carlos R. Mafra
parent
bb7d9b48bd
commit
56772f792c
@@ -79,7 +79,7 @@ RImage *RGetImageFromXPMData(RContext * context, char **xpmData)
|
||||
|
||||
/* make color table */
|
||||
for (i = 0; i < 4; i++) {
|
||||
color_table[i] = malloc(xpm.ncolors * sizeof(char));
|
||||
color_table[i] = malloc(xpm.ncolors * sizeof(unsigned char));
|
||||
if (!color_table[i]) {
|
||||
for (i = i - 1; i >= 0; i--) {
|
||||
if (color_table[i])
|
||||
@@ -199,7 +199,7 @@ RImage *RLoadXPM(RContext * context, const char *file)
|
||||
|
||||
/* make color table */
|
||||
for (i = 0; i < 4; i++) {
|
||||
color_table[i] = malloc(xpm.ncolors * sizeof(char));
|
||||
color_table[i] = malloc(xpm.ncolors * sizeof(unsigned char));
|
||||
if (!color_table[i]) {
|
||||
for (i = i - 1; i >= 0; i--) {
|
||||
if (color_table[i])
|
||||
|
||||
Reference in New Issue
Block a user