diff options
Diffstat (limited to 'lib/skin_parser')
-rw-r--r-- | lib/skin_parser/skin_buffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/skin_parser/skin_buffer.c b/lib/skin_parser/skin_buffer.c index d18122ef20..021746ba82 100644 --- a/lib/skin_parser/skin_buffer.c +++ b/lib/skin_parser/skin_buffer.c | |||
@@ -80,8 +80,8 @@ void* skin_buffer_alloc(size_t size) | |||
80 | { | 80 | { |
81 | void *retval = NULL; | 81 | void *retval = NULL; |
82 | #endif | 82 | #endif |
83 | /* 32-bit aligned */ | 83 | /* align to long which is enough for most types */ |
84 | size = (size + 3) & ~3; | 84 | size = (size + sizeof(long) - 1) & ~(sizeof(long) - 1); |
85 | if (size > skin_buffer_freespace()) | 85 | if (size > skin_buffer_freespace()) |
86 | { | 86 | { |
87 | skin_error(MEMORY_LIMIT_EXCEEDED, NULL); | 87 | skin_error(MEMORY_LIMIT_EXCEEDED, NULL); |