diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-12-02 01:26:01 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-12-02 01:26:01 +0000 |
commit | f940655fc3e16613c7dcec4537b16544366a6de1 (patch) | |
tree | 203342bb4537e152eac2b114b2746fa619003d82 /src | |
parent | a74c61d67fa8d6a90d689d0e7cd74b68f8f398d1 (diff) | |
download | libcss-f940655fc3e16613c7dcec4537b16544366a6de1.tar.gz libcss-f940655fc3e16613c7dcec4537b16544366a6de1.tar.bz2 |
Rather less memory corruption.
svn path=/trunk/libcss/; revision=5869
Diffstat (limited to 'src')
-rw-r--r-- | src/parse/properties.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/parse/properties.c b/src/parse/properties.c index 3e5ca88..b531f90 100644 --- a/src/parse/properties.c +++ b/src/parse/properties.c @@ -880,17 +880,17 @@ css_error parse_background_position(css_language *c, /* Copy the bytecode to it */ memcpy((*result)->bytecode, &opv, sizeof(opv)); if ((flags & FLAG_INHERIT) == false) { + uint8_t *ptr = ((uint8_t *) (*result)->bytecode) + sizeof(opv); if (value[0] == BACKGROUND_POSITION_HORZ_SET) { - memcpy(((uint8_t *) (*result)->bytecode) + sizeof(opv), - &length[0], sizeof(length)); - memcpy(((uint8_t *) (*result)->bytecode) + sizeof(opv) + - sizeof(length), &unit[0], sizeof(unit)); + memcpy(ptr, &length[0], sizeof(length[0])); + ptr += sizeof(length[0]); + memcpy(ptr, &unit[0], sizeof(unit[0])); + ptr += sizeof(unit[0]); } if (value[1] == BACKGROUND_POSITION_VERT_SET) { - memcpy(((uint8_t *) (*result)->bytecode) + sizeof(opv), - &length[1], sizeof(length)); - memcpy(((uint8_t *) (*result)->bytecode) + sizeof(opv) + - sizeof(length), &unit[1], sizeof(unit)); + memcpy(ptr, &length[1], sizeof(length[1])); + ptr += sizeof(length[1]); + memcpy(ptr, &unit[1], sizeof(unit[1])); } } |