From d4dc2a3a4f08c2c725ddf4203ecf6618b4e3fa19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Sat, 13 Nov 2010 21:42:34 +0100 Subject: [PATCH] widl: Fix for typelib generation when unaligned access to memory is not allowed. --- tools/widl/write_msft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index da4eb25b75b..874d3ad497d 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -1208,7 +1208,7 @@ static void write_value(msft_typelib_t* typelib, int *out, int vt, const void *v int len = strlen(s), seg_len = (len + 6 + 3) & ~0x3; int offset = ctl2_alloc_segment(typelib, MSFT_SEG_CUSTDATA, seg_len, 0); *((unsigned short *)&typelib->typelib_segment_data[MSFT_SEG_CUSTDATA][offset]) = vt; - *((unsigned int *)&typelib->typelib_segment_data[MSFT_SEG_CUSTDATA][offset+2]) = len; + memcpy(&typelib->typelib_segment_data[MSFT_SEG_CUSTDATA][offset+2], &len, sizeof(len)); memcpy(&typelib->typelib_segment_data[MSFT_SEG_CUSTDATA][offset+6], value, len); len += 6; while(len < seg_len) {