summaryrefslogtreecommitdiff
path: root/content/handlers/html/imagemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'content/handlers/html/imagemap.c')
-rw-r--r--content/handlers/html/imagemap.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/content/handlers/html/imagemap.c b/content/handlers/html/imagemap.c
index d26ba5f4d..f23be2353 100644
--- a/content/handlers/html/imagemap.c
+++ b/content/handlers/html/imagemap.c
@@ -36,7 +36,8 @@
#include "content/hlcache.h"
#include "html/box.h"
-#include "html/html_internal.h"
+#include "html/box_construct.h"
+#include "html/private.h"
#include "html/imagemap.h"
#define HASH_SIZE 31 /* fixed size hash table */
@@ -376,14 +377,14 @@ imagemap_addtolist(const struct html_content *c,
}
if (target != NULL) {
- /* Copy target into the map */
+ /* Copy target dom string into the map data */
new_map->target = malloc(dom_string_byte_length(target) + 1);
if (new_map->target == NULL)
goto bad_out;
- strncpy(new_map->target,
- dom_string_data(target),
- dom_string_byte_length(target));
+ memcpy(new_map->target,
+ dom_string_data(target),
+ dom_string_byte_length(target));
new_map->target[dom_string_byte_length(target)] = 0;
}