summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-11-04 18:45:03 +0100
committerTyge Løvset <[email protected]>2022-11-04 18:45:03 +0100
commita2c92b493e80a78a634b72bf0bbcf8dafb064f6d (patch)
treee439cd8b503a1244bb8e3caa5834d5f52028723e
parent41795cba77b5559e702bc5b749fb2d8dc5c6d8bf (diff)
downloadSTC-modified-a2c92b493e80a78a634b72bf0bbcf8dafb064f6d.tar.gz
STC-modified-a2c92b493e80a78a634b72bf0bbcf8dafb064f6d.zip
csmap: bug fix from previous commit: forgot to init zero-node (1st node in array)
-rwxr-xr-xexamples/make.sh2
-rw-r--r--include/stc/csmap.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/examples/make.sh b/examples/make.sh
index ff452ce8..c60ac3d4 100755
--- a/examples/make.sh
+++ b/examples/make.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-cc='gcc -s -O2 -Wall -std=c99 -pedantic -Wfatal-errors'
+cc='gcc -s -O2 -Wall -std=c99 -pedantic -Wfatal-errors -fsanitize=address'
#cc='tcc -s -O2 -Wall -std=c99 -pedantic -Wfatal-errors'
#cc='clang -s -O2 -Wall -std=c99 -pedantic -Wfatal-errors'
#cc='clang -s -O2 -Wall -std=c99 -pedantic -Wfatal-errors -DSTC_CSTR_V1 -DSTC_CSMAP_V1'
diff --git a/include/stc/csmap.h b/include/stc/csmap.h
index 35b89eea..cea60851 100644
--- a/include/stc/csmap.h
+++ b/include/stc/csmap.h
@@ -238,6 +238,7 @@ _cx_memb(_reserve)(_cx_self* self, const size_t cap) {
if (!nodes)
return false;
self->cap = cap;
+ nodes[0] = (_cx_node){{0, 0}, 0};
self->nodes = nodes;
return true;
}