diff options
author | Mike Frysinger <vapier@gentoo.org> | 2017-01-23 13:48:12 -1000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2017-01-23 13:48:12 -1000 |
commit | 0fa69c398bad7bda3486b713e995be01847126d1 (patch) | |
tree | 68a444160f09398b967ca78b12407c5ae0c001a5 | |
parent | security: fix building on much older systems (diff) | |
download | pax-utils-0fa69c398bad7bda3486b713e995be01847126d1.tar.gz pax-utils-0fa69c398bad7bda3486b713e995be01847126d1.tar.bz2 pax-utils-0fa69c398bad7bda3486b713e995be01847126d1.zip |
scanelf: change abs() to a size_t cast
The point of using abs here was to avoid a signed-vs-unsigned warning,
but it doesn't actually work because abs() returns a signed integer.
Since we always know end is larger than start, cast the result to a
size_t instead.
-rw-r--r-- | scanelf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -836,7 +836,7 @@ static void scanelf_file_rpath(elfobj *elf, char *found_rpath, char **ret, size_ while (start) { \ rpath_security_checks(elf, start, get_elfdtype(word)); \ end = strchr(start, ':'); \ - len = (end ? abs(end - start) : strlen(start)); \ + len = (end ? (size_t)(end - start) : strlen(start)); \ if (use_ldcache) { \ size_t n; \ const char *ldpath; \ |