MCPcopy Create free account
hub / github.com/albertobsd/keyhunt / stringtokenizer

Function stringtokenizer

util.c:67–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void stringtokenizer(char *data,Tokenizer *t) {
68 char *token;
69 t->tokens = NULL;
70 t->n = 0;
71 t->current = 0;
72 trim(data,"\t\n\r :");
73 token = strtok(data," \t:");
74 while(token != NULL) {
75 t->n++;
76 t->tokens = (char**) realloc(t->tokens,sizeof(char*)*t->n);
77 if(t->tokens == NULL) {
78 printf("Out of memory\n");
79 exit(0);
80 }
81 t->tokens[t->n - 1] = token;
82 token = strtok(NULL," \t:");
83 }
84}
85
86void freetokenizer(Tokenizer *t) {
87 if(t->n > 0) {

Callers 5

keyhunt_legacy.cppFile · 0.85
forceReadFileXPointFunction · 0.85
client_handlerFunction · 0.85
keyhunt.cppFile · 0.85
forceReadFileXPointFunction · 0.85

Calls 1

trimFunction · 0.85

Tested by

no test coverage detected