diff --git a/usr.bin/gprof/aout.c b/usr.bin/gprof/aout.c index 76ad07ea86df..7907d466df68 100644 --- a/usr.bin/gprof/aout.c +++ b/usr.bin/gprof/aout.c @@ -132,7 +132,7 @@ getsymtab(FILE *nfile, const char *filename) errx( 1 , "%s: no symbols" , filename ); askfor = nname + 1; nl = (nltype *) calloc( askfor , sizeof(nltype) ); - if (nl == 0) + if (nl == NULL) errx( 1 , "no room for %zu bytes of symbol table" , askfor * sizeof(nltype) ); @@ -173,7 +173,7 @@ gettextspace(FILE *nfile) { textspace = (u_char *) malloc( xbuf.a_text ); - if ( textspace == 0 ) { + if ( textspace == NULL ) { warnx("no room for %u bytes of text space: can't do -c" , xbuf.a_text ); return; diff --git a/usr.bin/gprof/arcs.c b/usr.bin/gprof/arcs.c index c5b2e96bbe06..4bea6c67186b 100644 --- a/usr.bin/gprof/arcs.c +++ b/usr.bin/gprof/arcs.c @@ -376,7 +376,7 @@ cyclelink(void) * i.e. it is origin 1, not origin 0. */ cyclenl = (nltype *) calloc( ncycle + 1 , sizeof( nltype ) ); - if ( cyclenl == 0 ) + if ( cyclenl == NULL ) errx( 1 , "no room for %zu bytes of cycle headers" , ( ncycle + 1 ) * sizeof( nltype ) ); /* @@ -479,7 +479,7 @@ cycleanalyze(void) continue; done = FALSE; cyclestack = (arctype **) calloc( size + 1 , sizeof( arctype *) ); - if ( cyclestack == 0 ) + if ( cyclestack == NULL ) errx( 1, "no room for %zu bytes of cycle stack" , ( size + 1 ) * sizeof( arctype * ) ); # ifdef DEBUG @@ -592,7 +592,7 @@ addcycle(arctype **stkstart, arctype **stkend) } clp = (cltype *) calloc( 1 , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) ); - if ( clp == 0 ) { + if ( clp == NULL ) { warnx( "no room for %zu bytes of subcycle storage" , sizeof ( cltype ) + ( size - 1 ) * sizeof( arctype * ) ); return( FALSE ); diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c index e05d628e4cf8..879b0acb75ae 100644 --- a/usr.bin/gprof/gprof.c +++ b/usr.bin/gprof/gprof.c @@ -407,7 +407,7 @@ readsamples(FILE *pfile) if (samples == 0) { samples = (double *) calloc(nsamples, sizeof(double)); - if (samples == 0) + if (samples == NULL) errx(0, "no room for %d sample pc's", nsamples); } for (i = 0; i < nsamples; i++) {