I'm running this string through strtok():
00:name:2:morename:2204a3741a4f4c636acb71cca5da1b0 041446e554d9fb1a2dceec29428491a17
Code:
- calling function - reads the above line from a text file and sends it to the split function
csflsplit_b(line, sizeof(line)/sizeof(char), ":");
void split_b (char line[], int len, char delims[]) {
char *result = NULL;
result = strtok(line, delims);
while (result != NULL) {
printf("%s\n", result);
result = strtok(NULL, delims);
}
}
Now, this prints out the following:
Code:
bob@host ~/stuff $ ./test
00
Neuni
2
neuni
2204a3741a4f4c636acb71cca5da1b0041446e554d9fb1a2dceec29428491a17
bob@host ~/Working-copies/cprojects/nettconf-cli $
This shows that the last part - 2204a3741a4f4c636acb71cca5da1b0041446e554d9fb1a2dc eec29428491a17 - must have a line-break which strtok includes, doesn't it?