From c48ffae4de88d027ae73ed2dc78afeb78188c35c Mon Sep 17 00:00:00 2001 From: Snaipe Date: Wed, 14 Sep 2016 00:47:29 +0200 Subject: [PATCH] mach-o,section: Fixed compilation errors --- src/compat/section-mach-o.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compat/section-mach-o.c b/src/compat/section-mach-o.c index ad3b301..27346db 100644 --- a/src/compat/section-mach-o.c +++ b/src/compat/section-mach-o.c @@ -21,6 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#include #include #include #include @@ -51,7 +52,7 @@ static inline void *ptr_add(const void *ptr, size_t off) return (char *) ptr + off; } -static int sections_getaddr(int lib, const char *sectname, +static int section_getaddr(int lib, const char *sectname, struct cri_section *sect) { const struct mach_header *hdr = _dyld_get_image_header(lib); @@ -64,7 +65,7 @@ static int sections_getaddr(int lib, const char *sectname, continue; const struct section *s = ptr_add(sc, sizeof (*sc)); for (size_t j = 0; j < sc->nsects; ++j, ++s) { - if (strncmp(name, s->sectname, 16)) + if (strncmp(sectname, s->sectname, 16)) continue; sect->length = s->size; @@ -77,7 +78,7 @@ static int sections_getaddr(int lib, const char *sectname, continue; const struct section_64 *s = ptr_add(sc, sizeof (*sc)); for (size_t j = 0; j < sc->nsects; ++j, ++s) { - if (strncmp(name, s->sectname, 16)) + if (strncmp(sectname, s->sectname, 16)) continue; sect->length = s->size;