From e751fa847caee5c8fc6c1bd0c7f49505d685bea6 Mon Sep 17 00:00:00 2001 From: epochqwert Date: Sat, 7 Feb 2015 04:38:07 -0600 Subject: a bit of cleanup. --- misc/svgmap/paths-to-edges.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'misc') 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; -- cgit v1.2.3