summaryrefslogtreecommitdiffstats
path: root/XUtils.c
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2022-01-11 21:34:47 +0100
committerBenBE <BenBE@geshi.org>2022-01-11 21:42:57 +0100
commita133ffd8295302ea5fb0ba6f609e811adc7d1d9d (patch)
tree8d019e4f59e33e2417baa70084d148a0f4f1bcf8 /XUtils.c
parentfde12434432f51ed773957824aa9460f5cc99e85 (diff)
Removed unused String_getToken function
Since String_getToken is not used anymore and currently only supports a 50 char token, simply remove it for now.
Diffstat (limited to 'XUtils.c')
-rw-r--r--XUtils.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/XUtils.c b/XUtils.c
index 96e93cbb..827fa950 100644
--- a/XUtils.c
+++ b/XUtils.c
@@ -161,35 +161,6 @@ void String_freeArray(char** s) {
free(s);
}
-char* String_getToken(const char* line, const unsigned short int numMatch) {
- const size_t len = strlen(line);
- char inWord = 0;
- unsigned short int count = 0;
- char match[50];
-
- size_t foundCount = 0;
-
- for (size_t i = 0; i < len; i++) {
- char lastState = inWord;
- inWord = line[i] == ' ' ? 0 : 1;
-
- if (lastState == 0 && inWord == 1)
- count++;
-
- if (inWord == 1) {
- if (count == numMatch && line[i] != ' ' && line[i] != '\0' && line[i] != '\n' && line[i] != (char)EOF) {
- if (foundCount == sizeof(match) / sizeof(match[0]) - 1)
- break;
- match[foundCount] = line[i];
- foundCount++;
- }
- }
- }
-
- match[foundCount] = '\0';
- return xStrdup(match);
-}
-
char* String_readLine(FILE* fd) {
const size_t step = 1024;
size_t bufSize = step;

© 2014-2024 Faster IT GmbH | imprint | privacy policy