[Rpm-maint] [rpm-software-management/rpm] elfdeps: Add full multiarch deps support (#360)

Panu Matilainen notifications at github.com
Mon Feb 19 14:55:14 UTC 2018


pmatilai commented on this pull request.



> +	snprintf(archmarker, sizeof(archmarker), "(%s%s-%s)", elf_machine, elf_endian, elf_bitsize);
+	break;
+    case EM_X86_64:
+	/* This handling for x32 makes me weep inside... */
+	if (ehdr->e_ident[EI_CLASS] == ELFCLASS32) {
+	    snprintf(archmarker, sizeof(archmarker), "(%s-%s-%s)", elf_machine, "64", "x32");
+	} else {
+	    snprintf(archmarker, sizeof(archmarker), "(%s-%s)", elf_machine, elf_bitsize);
+	}
+	break;
+    default:
+	snprintf(archmarker, sizeof(archmarker), "(%s-%s)", elf_machine, elf_bitsize);
+	break;
+    }
+
+    return strndup(archmarker, strlen(archmarker));

Um, why the static-sized "lets hope this is enough" buffer when you end up strdup()'ing it afterall?
Just use rasprintf() to construct the marker to begin with...

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/360#pullrequestreview-97569346
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180219/47bcc008/attachment.html>


More information about the Rpm-maint mailing list