Fixed more font stuff, works really really good now.

This commit is contained in:
2023-01-14 23:34:15 -08:00
parent 0558b3bb25
commit 18d3b074f9
14 changed files with 81 additions and 25 deletions

View File

@ -89,6 +89,10 @@ int main(int argc, char *argv[]) {
char *key = csvGetCell(&csv, y, 0);
char *value = csvGetCell(&csv, y, 1);
// 23/01/14 - Replace \r in CSV.
stringRemoveAll(key, '\r');
stringRemoveAll(value, '\r');
if(strlen(key) <= 0 || strlen(value) <= 0) {
printf("Failed to parse language. Line %i has an invalid string\n", y);
fclose(file);

View File

@ -7,6 +7,7 @@
#pragma once
#include "common.h"
#include "string.h"
#define CSV_ROW_COUNT_MAX 128

View File

@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include "common.h"
static inline void stringRemoveAll(char *string, char remove) {
size_t len = strlen(string);
size_t i, j;
i = 0;
while(i < len) {
char c = string[i];
if(c != remove) {
i++;
continue;
}
j = i + 1;
while(j < len) {
string[j-1] = string[j];
j++;
}
len--;
}
}