harec

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

commit 03bd0eb625f5d268f5fb8f6d814dce3c67ced2a5
parent 743422294af3237aa783e6a66eb51412f5e2ed01
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu, 31 Dec 2020 17:07:27 -0500

lex: fix invalid allocation

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

diff --git a/src/lex.c b/src/lex.c @@ -488,7 +488,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, sizeof(char)); + char *buf = xcalloc(lexer->buflen, lexer->buflen); memcpy(buf, lexer->buf, lexer->buflen); out->token = T_LITERAL; out->storage = TYPE_STORAGE_STRING;