diff --git a/lib/libprocstat/core.c b/lib/libprocstat/core.c index dea078c848e..cf3435a10c7 100644 --- a/lib/libprocstat/core.c +++ b/lib/libprocstat/core.c @@ -119,7 +119,7 @@ procstat_core_open(const char *filename) warnx("%s is not a CORE file", filename); goto fail; } - if (elf_getphnum(e, &nph) == 0) { + if (elf_getphdrnum(e, &nph) == -1) { warnx("program headers not found"); goto fail; }