diff options
author | "John Hawthorn ext:(%22) <jhawthor@uvic.ca> | 2008-12-31 18:00:06 -0800 |
---|---|---|
committer | "John Hawthorn ext:(%22) <jhawthor@uvic.ca> | 2008-12-31 18:00:06 -0800 |
commit | c6ef9db927d48062fcfd1ba43ad9fd4bbbb5a63c (patch) | |
tree | bfefe1e078b7e7bc106a6caae726d5df1d663002 | |
parent | bf9f8695786a65e5dcf9d2dc02bc60369063b80a (diff) | |
download | mirror-meh-c6ef9db927d48062fcfd1ba43ad9fd4bbbb5a63c.tar.gz mirror-meh-c6ef9db927d48062fcfd1ba43ad9fd4bbbb5a63c.tar.bz2 mirror-meh-c6ef9db927d48062fcfd1ba43ad9fd4bbbb5a63c.zip |
minor bug
-rw-r--r-- | src/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -284,9 +284,12 @@ void readlist(FILE *f){ char *line = NULL; size_t slen = 0; ssize_t read; - if((read = getline(&line, &slen, f)) > 0){ + read = getline(&line, &slen, f); + if(read > 1){ line[read-1] = '\0'; images[imageslen++] = line; + }else if(line){ + free(line); } } lsize *= 2; |