summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-19 18:54:18 -0500
committermidipix <writeonce@midipix.org>2016-11-19 18:54:18 -0500
commitb7ba5f6a9f7dcfecfce52fea5c3af6e9700a24d8 (patch)
treeccd651261dd3fc4f0f0da89c563790ec6cd4d163
parentb8d16a54c152350766d1724c924c53c5bd3236fe (diff)
downloadpemagine-b7ba5f6a9f7dcfecfce52fea5c3af6e9700a24d8.tar.bz2
pemagine-b7ba5f6a9f7dcfecfce52fea5c3af6e9700a24d8.tar.xz
pe_get_image_opt_hdr_addr(): code maintenance.
-rw-r--r--src/headers/pe_get_image_opt_hdr_addr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/headers/pe_get_image_opt_hdr_addr.c b/src/headers/pe_get_image_opt_hdr_addr.c
index d784aed..7fcd0ad 100644
--- a/src/headers/pe_get_image_opt_hdr_addr.c
+++ b/src/headers/pe_get_image_opt_hdr_addr.c
@@ -11,10 +11,12 @@
pe_api
union pe_raw_opt_hdr * pe_get_image_opt_hdr_addr(const void * base)
{
- struct pe_raw_coff_file_hdr * coff;
+ struct pe_raw_coff_file_hdr * coff;
+ void * addr;
if (!(coff = pe_get_image_coff_hdr_addr(base)))
return 0;
- else
- return (union pe_raw_opt_hdr *)pe_va_from_rva(coff, sizeof(*coff));
+
+ addr = pe_va_from_rva(coff,sizeof(*coff));
+ return (union pe_raw_opt_hdr *)addr;
}