diff options
Diffstat (limited to 'src/model/count.c')
-rw-r--r-- | src/model/count.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/model/count.c b/src/model/count.c index d42f806..274b9d8 100644 --- a/src/model/count.c +++ b/src/model/count.c @@ -1,13 +1,17 @@ +#include <assert.h> #include <sys/types.h> #include <libelfu/libelfu.h> +/* NULL section is not counted! */ size_t elfu_countSections(ElfuElf *me) { ElfuScn *ms; size_t i = 0; + assert(me); + CIRCLEQ_FOREACH(ms, &me->scnList, elem) { i++; } @@ -21,6 +25,8 @@ size_t elfu_countPHDRs(ElfuElf *me) ElfuPhdr *mp; size_t i = 0; + assert(me); + CIRCLEQ_FOREACH(mp, &me->phdrList, elem) { i++; } |