mirror of
https://github.com/troglobit/libite.git
synced 2026-10-01 05:22:34 +07:00
lfile: Initialize strtok_r() save pointer
Must initialize the save pointer in the parser context, otherwise strtok_r() will fail on statically built embedded targets. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -47,8 +47,9 @@ lfile_t *lfopen(char *file, char *sep)
|
||||
/* Use calloc for clearing buf on behalf of lftok() */
|
||||
lf = calloc(sizeof(*lf), sizeof(char));
|
||||
if (lf) {
|
||||
lf->fp = fopen(file, "r");
|
||||
lf->sep = sep;
|
||||
lf->fp = fopen(file, "r");
|
||||
lf->sep = sep;
|
||||
lf->save = lf->buf;
|
||||
|
||||
if (!lf->fp) {
|
||||
free(lf);
|
||||
|
||||
Reference in New Issue
Block a user