harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 2ee15aa5ce2e1e5bde880dd53e8bf5631f96f014
parent 9eafbda99da209fe668c210387994a88eec9d486
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sat, 19 Feb 2022 19:11:08 -0500

lex: fix incorrect xcalloc parameters

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Msrc/lex.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lex.c b/src/lex.c @@ -551,7 +551,7 @@ lex_string(struct lexer *lexer, struct token *out) while ((c = next(lexer, NULL, false)) != UTF8_INVALID) { switch (c) { case '"':; - char *buf = xcalloc(lexer->buflen, lexer->buflen); + char *buf = xcalloc(lexer->buflen, 1); memcpy(buf, lexer->buf, lexer->buflen); out->token = T_LITERAL; out->storage = STORAGE_STRING;