aboutsummaryrefslogtreecommitdiff
path: root/contrib/one-true-awk/lex.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2019-06-02 16:28:20 +0000
committerWarner Losh <imp@FreeBSD.org>2019-06-02 16:28:20 +0000
commit10ce5b990fc0c874071c21e47d02194337732f27 (patch)
tree0f2f94416388052f6c081577884e66064bf85dcf /contrib/one-true-awk/lex.c
parentb5253557294400621041b8ce1dfbf11e124c1575 (diff)
downloadsrc-10ce5b990fc0c874071c21e47d02194337732f27.tar.gz
src-10ce5b990fc0c874071c21e47d02194337732f27.zip
Notes
Diffstat (limited to 'contrib/one-true-awk/lex.c')
-rw-r--r--contrib/one-true-awk/lex.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/one-true-awk/lex.c b/contrib/one-true-awk/lex.c
index 18927f842b23..8e689f1a682a 100644
--- a/contrib/one-true-awk/lex.c
+++ b/contrib/one-true-awk/lex.c
@@ -176,10 +176,10 @@ int reg = 0; /* 1 => return a REGEXPR now */
int yylex(void)
{
int c;
- static char *buf = 0;
+ static char *buf = NULL;
static int bufsize = 5; /* BUG: setting this small causes core dump! */
- if (buf == 0 && (buf = (char *) malloc(bufsize)) == NULL)
+ if (buf == NULL && (buf = (char *) malloc(bufsize)) == NULL)
FATAL( "out of space in yylex" );
if (sc) {
sc = 0;
@@ -366,10 +366,10 @@ int string(void)
{
int c, n;
char *s, *bp;
- static char *buf = 0;
+ static char *buf = NULL;
static int bufsz = 500;
- if (buf == 0 && (buf = (char *) 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"))
@@ -513,11 +513,11 @@ void startreg(void) /* next call to yylex will return a regular expression */
int regexpr(void)
{
int c;
- static char *buf = 0;
+ static char *buf = NULL;
static int bufsz = 500;
char *bp;
- if (buf == 0 && (buf = (char *) 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; ) {
@@ -549,7 +549,7 @@ char ebuf[300];
char *ep = ebuf;
char yysbuf[100]; /* pushback buffer */
char *yysptr = yysbuf;
-FILE *yyin = 0;
+FILE *yyin = NULL;
int input(void) /* get next lexical input character */
{