Fixed more font stuff, works really really good now.
This commit is contained in:
@ -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);
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
#include "common.h"
|
||||
#include "string.h"
|
||||
|
||||
#define CSV_ROW_COUNT_MAX 128
|
||||
|
||||
|
30
src/dawntools/utils/string.h
Normal file
30
src/dawntools/utils/string.h
Normal 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--;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user