aboutsummaryrefslogtreecommitdiffstats
path: root/test/c/knucleotide.c
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-08-26 12:47:25 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-08-26 12:47:25 +0200
commite0f1a60f5ff9d2efc8b106b5167f0170b8795dbe (patch)
treefe5c4c0b3da0b30841eef8184dade6e39e2c7407 /test/c/knucleotide.c
parent8d2e4a51d56b7f4d3673a5132edd1adb37a14295 (diff)
parent7cfaf10b604372044f53cb65b03df33c23f8b26d (diff)
downloadcompcert-kvx-e0f1a60f5ff9d2efc8b106b5167f0170b8795dbe.tar.gz
compcert-kvx-e0f1a60f5ff9d2efc8b106b5167f0170b8795dbe.zip
Merge branch 'master' into debug_locations
Conflicts: debug/CtoDwarf.ml debug/DwarfPrinter.ml debug/DwarfTypes.mli
Diffstat (limited to 'test/c/knucleotide.c')
-rw-r--r--test/c/knucleotide.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/c/knucleotide.c b/test/c/knucleotide.c
index f7438926..6bd0e9e7 100644
--- a/test/c/knucleotide.c
+++ b/test/c/knucleotide.c
@@ -62,10 +62,11 @@ struct ht_node *ht_node_create(char *key) {
perror("malloc ht_node");
exit(1);
}
- if ((newkey = (char *)strdup(key)) == 0) {
+ if ((newkey = malloc(strlen(key) + 1)) == 0) {
perror("strdup newkey");
exit(1);
}
+ strcpy(newkey, key);
node->key = newkey;
node->val = 0;
node->next = (struct ht_node *)NULL;