Date: Tue, 19 Apr 2016 02:05:32 +0000 (UTC) From: Marcelo Araujo <araujo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298241 - head/usr.bin/lex Message-ID: <201604190205.u3J25Wpn002224@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: araujo Date: Tue Apr 19 02:05:32 2016 New Revision: 298241 URL: https://svnweb.freebsd.org/changeset/base/298241 Log: Use NULL instead of 0 for pointers. realloc will return NULL in case it cannot allocate memory. MFC after: 2 weeks. Modified: head/usr.bin/lex/initparse.c head/usr.bin/lex/initscan.c Modified: head/usr.bin/lex/initparse.c ============================================================================== --- head/usr.bin/lex/initparse.c Tue Apr 19 02:00:48 2016 (r298240) +++ head/usr.bin/lex/initparse.c Tue Apr 19 02:05:32 2016 (r298241) @@ -680,14 +680,14 @@ static int yygrowstack(YYSTACKDATA *data i = data->s_mark - data->s_base; newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) + if (newss == NULL) return -1; data->s_base = newss; data->s_mark = newss + i; newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) + if (newvs == NULL) return -1; data->l_base = newvs; @@ -721,7 +721,7 @@ YYPARSE_DECL() #if YYDEBUG const char *yys; - if ((yys = getenv("YYDEBUG")) != 0) + if ((yys = getenv("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') Modified: head/usr.bin/lex/initscan.c ============================================================================== --- head/usr.bin/lex/initscan.c Tue Apr 19 02:00:48 2016 (r298240) +++ head/usr.bin/lex/initscan.c Tue Apr 19 02:05:32 2016 (r298241) @@ -3455,7 +3455,7 @@ YY_RULE_SETUP } nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ - if ( (nmdefptr = ndlookup( nmstr )) == 0 ) + if ( (nmdefptr = ndlookup( nmstr )) == NULL ) format_synerr( _( "undefined definition {%s}" ), nmstr );
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604190205.u3J25Wpn002224>