Commit 9d26c6d7 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

widl: Properly align name table entries.

parent f3ca3044
...@@ -192,10 +192,15 @@ static int add_name(struct sltg_data *name_table, const char *name) ...@@ -192,10 +192,15 @@ static int add_name(struct sltg_data *name_table, const char *name)
{ {
int name_offset = name_table->size; int name_offset = name_table->size;
int new_size = name_table->size + strlen(name) + 1 + 8; int new_size = name_table->size + strlen(name) + 1 + 8;
int aligned_size;
chat("add_name: %s\n", name); chat("add_name: %s\n", name);
new_size = (new_size + 1) & ~1; /* align */ aligned_size = (new_size + 0x1f) & ~0x1f;
if (aligned_size - new_size < 4)
new_size = aligned_size;
else
new_size = (new_size + 1) & ~1;
if (new_size > name_table->allocated) if (new_size > name_table->allocated)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment