aboutsummaryrefslogtreecommitdiff
path: root/lex.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-10-13 20:52:43 +0300
committerArnold D. Robbins <arnold@skeeve.com>2020-10-13 20:52:43 +0300
commit3b42cfaf73fbe63c1332f9cf2c8e4d90ab686f05 (patch)
tree5eb762eb83229cbd64f59d7fa3e4ba2c3580f97a /lex.c
parent9804285af0866f90731a6e0ce767ab0e7b23b6c6 (diff)
downloadone-true-awk-3b42cfaf73fbe63c1332f9cf2c8e4d90ab686f05.tar.gz
Make it compile with g++.
Diffstat (limited to 'lex.c')
-rw-r--r--lex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lex.c b/lex.c
index 73cdddb..df39c8e 100644
--- a/lex.c
+++ b/lex.c
@@ -173,7 +173,7 @@ int yylex(void)
static char *buf = NULL;
static int bufsize = 5; /* BUG: setting this small causes core dump! */
- if (buf == NULL && (buf = malloc(bufsize)) == NULL)
+ if (buf == NULL && (buf = (char *) malloc(bufsize)) == NULL)
FATAL( "out of space in yylex" );
if (sc) {
sc = false;
@@ -370,7 +370,7 @@ int string(void)
static char *buf = NULL;
static int bufsz = 500;
- if (buf == NULL && (buf = malloc(bufsz)) == NULL)
+ if (buf == NULL && (buf = (char *) malloc(bufsz)) == NULL)
FATAL("out of space for strings");
for (bp = buf; (c = input()) != '"'; ) {
if (!adjbuf(&buf, &bufsz, bp-buf+2, 500, &bp, "string"))
@@ -519,7 +519,7 @@ int regexpr(void)
static int bufsz = 500;
char *bp;
- if (buf == NULL && (buf = malloc(bufsz)) == NULL)
+ if (buf == NULL && (buf = (char *) malloc(bufsz)) == NULL)
FATAL("out of space for rex expr");
bp = buf;
for ( ; (c = input()) != '/' && c != 0; ) {