summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-06 19:49:15 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-06 19:49:15 -0700
commita413f34351b6e72100bdbef7ae32d1266dfa8942 (patch)
tree2165b31f1af3e4383375fd028b84bfe13ae38028
parentf0d6e69279eaeb71a3e36b5cf40ba8384b1ec84c (diff)
Remove unnecessary casts from malloc() & memcpy() calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--showrgb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/showrgb.c b/showrgb.c
index 8f3fb81..6174be9 100644
--- a/showrgb.c
+++ b/showrgb.c
@@ -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