Skip to content
Snippets Groups Projects
Commit da1b579c authored by Alam Ed Arias's avatar Alam Ed Arias
Browse files

Tokenizer_Open: pad the string with an NULL byte

parent 8c7fe2ae
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,10 @@
tokenizer_t *Tokenizer_Open(const char *inputString, size_t len, unsigned numTokens)
{
tokenizer_t *tokenizer = Z_Malloc(sizeof(tokenizer_t), PU_STATIC, NULL);
const size_t lenpan = len+1;
tokenizer->zdup = malloc(len);
tokenizer->zdup = malloc(lenpan);
tokenizer->zdup[len] = 0x00;
tokenizer->input = M_Memcpy(tokenizer->zdup, inputString, len);
tokenizer->startPos = 0;
......
......@@ -16,7 +16,7 @@
typedef struct Tokenizer
{
void *zdup;
char *zdup;
const char *input;
unsigned numTokens;
UINT32 *capacity;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment