commit b022ad91a3cde32a50666e27064d214b291f413e
parent 5f2e4b1c300deb353d2edb965cee7462f465d54e
Author: Frederic Cambus <fred@statdns.com>
Date: Thu, 21 Feb 2019 23:08:36 +0100
Introduce a PCX_HEADER_LENGTH macro to define the length of the PCX header.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pcx2gba.c b/pcx2gba.c
@@ -17,6 +17,8 @@
#include <string.h>
#include <sys/stat.h>
+#define PCX_HEADER_LENGTH 128
+
FILE *input_file;
unsigned char *input_file_buffer;
int input_file_size;
@@ -83,7 +85,7 @@ int main(int argc, char *argv[]) {
fclose(input_file);
/* Check that the file is a valid 8-bpp PCX */
- memcpy(&pcx_header, input_file_buffer, 128);
+ memcpy(&pcx_header, input_file_buffer, PCX_HEADER_LENGTH);
if (pcx_header.bits_per_pixel != 8) {
printf("ERROR: Input File is not 8-bpp\n\n");