Cleanup: eliminate implicit sign-extension
[deliverable/lttng-ust.git] / liblttng-ust / lttng-ust-elf.c
index dd50f2b674d689d2be9831536790e064765b8164..8d3fc573f1b4fe8f0cbf655c54fa329c77efd2d7 100644 (file)
@@ -101,7 +101,7 @@ struct lttng_ust_elf_shdr *lttng_ust_elf_get_shdr(struct lttng_ust_elf *elf,
                                                uint16_t index)
 {
        struct lttng_ust_elf_shdr *shdr = NULL;
-       long offset;
+       off_t offset;
 
        if (!elf) {
                goto error;
@@ -116,7 +116,8 @@ struct lttng_ust_elf_shdr *lttng_ust_elf_get_shdr(struct lttng_ust_elf *elf,
                goto error;
        }
 
-       offset = elf->ehdr->e_shoff + index * elf->ehdr->e_shentsize;
+       offset = (off_t) elf->ehdr->e_shoff
+               + (off_t) index * elf->ehdr->e_shentsize;
        if (lseek(elf->fd, offset, SEEK_SET) < 0) {
                goto error;
        }
This page took 0.024979 seconds and 5 git commands to generate.