~kikoodx/sle

c5a202a6f613d85432af952f0b8e6306983104c5 — KikooDX 3 years ago 8f53ecb 0.2.1
fix: variable array length in C90, code wouldn't compile
1 files changed, 3 insertions(+), 3 deletions(-)

M src/strtocolor.c
M src/strtocolor.c => src/strtocolor.c +3 -3
@@ 8,8 8,8 @@
#include <stdlib.h>
#include <string.h>

static const int hex_table_size = 16;
static const int hex_table[hex_table_size] = {
#define HEX_TABLE_SIZE 16
static const int hex_table[HEX_TABLE_SIZE] = {
    '0', '1', '2', '3', '4', '5', '6', '7',
    '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
static const char *format_error =


@@ 33,7 33,7 @@ Color strtocolor(char *string)
	while (*character != '\0') {
		int value = -1;
		int j;
		for (j = 0; j < hex_table_size; j += 1) {
		for (j = 0; j < HEX_TABLE_SIZE; j += 1) {
			if (hex_table[j] == *character) {
				value = j;
				break;