diff options
-rw-r--r-- | src/parser.c | 2 | ||||
-rw-r--r-- | src/source.c | 14 | ||||
-rw-r--r-- | src/token.c | 3 |
3 files changed, 9 insertions, 10 deletions
diff --git a/src/parser.c b/src/parser.c index f7ababe..ac08a16 100644 --- a/src/parser.c +++ b/src/parser.c @@ -87,9 +87,7 @@ tree_t* parser_parse_carg(parser_t* parser) { tree_t* carg; carg = tree_init(TREE_TYPE_CARG); - carg->data.carg.val = parser_parse_expr(parser); - carg->data.carg.nxt = NULL; return carg; diff --git a/src/source.c b/src/source.c index bf6655c..26bbad2 100644 --- a/src/source.c +++ b/src/source.c @@ -35,16 +35,16 @@ char* source_get_from_stdin() { size_t l; #if 0 - l = 0; + l = 0; - src = ecalloc(16, sizeof(char)); + src = ecalloc(16, sizeof(char)); - while ((s = fgets(src + l, 20, stdin))) { - l = MIN(15, l + strlen(src + l)); - } + while ((s = fgets(src + l, 20, stdin))) { + l = MIN(15, l + strlen(src + l)); + } - /* This works, I guess. */ - s && src[l - 1] == '\n' && (src[l - 1] = '\0'); + /* This works, I guess. */ + s && src[l - 1] == '\n' && (src[l - 1] = '\0'); #endif src = ecalloc(256, sizeof(char)); diff --git a/src/token.c b/src/token.c index 6ae0eae..5092190 100644 --- a/src/token.c +++ b/src/token.c @@ -42,7 +42,8 @@ void token_add_char(token_t* token, char c) { orig = strlen(token->val); - token->val = erealloc(token->val, orig + sizeof c + 1); + /* [...] c+1 [...] */ + token->val = erealloc(token->val, orig + sizeof c+1); token->val[orig] = c; token->val[orig + 1] = '\0'; } |