1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- Subject: - C++ cast (...)
- Origin: FILE5_35-1-g338cc788 <https://github.com/file/file/commit/FILE5_35-1-g338cc788>
- Upstream-Author: Christos Zoulas <christos@zoulas.com>
- Date: Fri Oct 19 00:26:08 2018 +0000
- - C++ cast
- - return 0 instead of -1 for error in donote
- --- a/src/readelf.c
- +++ b/src/readelf.c
- @@ -786,8 +786,8 @@
- pidoff = argoff + 81 + 2;
- if (doff + pidoff + 4 <= size) {
- if (file_printf(ms, ", pid=%u",
- - elf_getu32(swap, *(uint32_t *)(nbuf +
- - doff + pidoff))) == -1)
- + elf_getu32(swap, *RCAST(uint32 *, (nbuf +
- + doff + pidoff)))) == -1)
- return 1;
- }
- *flags |= FLAGS_DID_CORE;
- @@ -1142,14 +1142,14 @@
- if (namesz & 0x80000000) {
- if (file_printf(ms, ", bad note name size %#lx",
- CAST(unsigned long, namesz)) == -1)
- - return -1;
- + return 0;
- return 0;
- }
-
- if (descsz & 0x80000000) {
- if (file_printf(ms, ", bad note description size %#lx",
- CAST(unsigned long, descsz)) == -1)
- - return -1;
- + return 0;
- return 0;
- }
-
- @@ -1668,7 +1668,7 @@
- case PT_INTERP:
- if (bufsize && nbuf[0]) {
- nbuf[bufsize - 1] = '\0';
- - memcpy(interp, nbuf, bufsize);
- + memcpy(interp, nbuf, (size_t)bufsize);
- } else
- strlcpy(interp, "*empty*", sizeof(interp));
- break;
|