diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-10-06 19:49:15 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-10-06 19:49:15 -0700 |
commit | a413f34351b6e72100bdbef7ae32d1266dfa8942 (patch) | |
tree | 2165b31f1af3e4383375fd028b84bfe13ae38028 | |
parent | f0d6e69279eaeb71a3e36b5cf40ba8384b1ec84c (diff) |
Remove unnecessary casts from malloc() & memcpy() calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | showrgb.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -94,7 +94,7 @@ dumprgb (const char *filename) if (value.dptr) { RGB rgb; unsigned short r, g, b; - memcpy( (char *)&rgb, value.dptr, sizeof rgb); + memcpy(&rgb, value.dptr, sizeof rgb); #define N(x) (((x) >> 8) & 0xff) r = N(rgb.red); g = N(rgb.green); @@ -130,7 +130,7 @@ dumprgb (const char *filename) exit (1); } #else - path = (char *)malloc(strlen(filename) + 5); + path = malloc(strlen(filename) + 5); strcpy(path, filename); strcat(path, ".txt"); #endif |