Use NULL instead of 0 for pointers.

realloc will return NULL in case it cannot allocate memory.

MFC after:	2 weeks.
This commit is contained in:
Marcelo Araujo 2016-04-19 02:05:32 +00:00
parent e63ce3de7f
commit c81a92db98
2 changed files with 4 additions and 4 deletions

View File

@ -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')

View File

@ -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 );