commit 03c59c1d581d2d4c61b5f8ac3ce60599534179c0
parent 10814498bc87e28f138db72f732bf2b2da46c179
Author: Frederic Cambus <fred@statdns.com>
Date: Fri, 29 Jun 2018 21:03:29 +0200
From the C99 standard, sizeof(unsigned char) is always 1
Diffstat:
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/loaders/artworx.c b/src/loaders/artworx.c
@@ -35,7 +35,7 @@ void artworx(struct input *inputFile, struct output *outputFile)
uint32_t index;
// process ADF font
- font_data_adf = (unsigned char *)malloc(sizeof (unsigned char)*4096);
+ font_data_adf = (unsigned char *)malloc(4096);
if (font_data_adf == NULL) {
perror("Memory error");
exit(7);
diff --git a/src/loaders/icedraw.c b/src/loaders/icedraw.c
@@ -27,7 +27,7 @@ void icedraw(struct input *inputFile, struct output *outputFile)
int32_t colors[16];
// process IDF font
- font_data_idf = (unsigned char *)malloc(sizeof (unsigned char)*4096);
+ font_data_idf = (unsigned char *)malloc(4096);
if (font_data_idf == NULL) {
perror("Memory error");
exit(7);
@@ -59,7 +59,7 @@ void icedraw(struct input *inputFile, struct output *outputFile)
for (idf_sequence_loop = 0; idf_sequence_loop < idf_sequence_length; idf_sequence_loop++)
{
// reallocate IDF buffer memory
- temp = realloc(idf_buffer, (i + 2) * sizeof (unsigned char));
+ temp = realloc(idf_buffer, i + 2);
if (idf_buffer != NULL) {
idf_buffer = temp;
}
@@ -76,7 +76,7 @@ void icedraw(struct input *inputFile, struct output *outputFile)
}
else {
// reallocate IDF buffer memory
- temp = realloc(idf_buffer, (i + 2) * sizeof (unsigned char));
+ temp = realloc(idf_buffer, i + 2);
if (idf_buffer != NULL) {
idf_buffer = temp;
}
diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c
@@ -70,7 +70,7 @@ void xbin(struct input *inputFile, struct output *outputFile)
int32_t numchars = (xbin_flags & 0x10 ? 512 : 256);
// allocate memory to contain the XBin font
- font_data_xbin = (unsigned char *)malloc(sizeof (unsigned char)*(xbin_fontsize * numchars));
+ font_data_xbin = (unsigned char *)malloc(xbin_fontsize * numchars);
if (font_data_xbin == NULL) {
perror("Memory error");
exit(5);