readelf.c: fix a compiler warning
Fix the following compiler warning:
CC readelf.lo
readelf.c: In function ‘get_arch_from_elf’:
readelf.c:72: warning: comparison between signed and unsigned
The problem is when comparing signed and unsigned, both operands are
cast to unsigned, therefore the code was not able to detect that read()
returned -1. By casting result of sizeof() to int we are now comparing
signed integers and can now detect -1 from read().
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed