diff options
Diffstat (limited to 'misc/svgmap')
-rw-r--r-- | misc/svgmap/paths-to-edges.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/misc/svgmap/paths-to-edges.c b/misc/svgmap/paths-to-edges.c index 526f890..7e485b1 100644 --- a/misc/svgmap/paths-to-edges.c +++ b/misc/svgmap/paths-to-edges.c @@ -8,7 +8,7 @@ struct link { int count;
};
-struct link ** get_links(char ***data) {
+struct link **get_links(char ***data) {
int i,j,k=0;
for(i=0;data[i];i++) {
for(j=0;data[i][j];j++) {
@@ -16,8 +16,7 @@ struct link ** get_links(char ***data) { //new space allocated.
}
}
- struct link **link=malloc(sizeof(struct link *) * k+1); //???
- memset(link,0,sizeof(struct link *) * k+1);
+ struct link **link=calloc(k+1,sizeof(struct link *));
for(i=0;data[i];i++) {
for(j=0;data[i][j+1];j++) {
for(k=0;link[k];k++) {
@@ -68,7 +67,6 @@ char *recurse_readline(int chars) { return malloced;
}
-//this is the function failing on full-size data.
char ***lines_to_data(char **lines) {
char ***data;
int i,j,k,n,m;
@@ -85,7 +83,6 @@ char ***lines_to_data(char **lines) { data[i+1]=0;
data[i][k]=0;
}
-/* in this for loop somewhere. */
for(i=0;lines[i];i++) {
k=0;
n=0;
|