summaryrefslogtreecommitdiff
path: root/noncore/todayplugins/stockticker/libstocks/csv.c
Unidiff
Diffstat (limited to 'noncore/todayplugins/stockticker/libstocks/csv.c') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/libstocks/csv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/todayplugins/stockticker/libstocks/csv.c b/noncore/todayplugins/stockticker/libstocks/csv.c
index 6170bed..86d8607 100644
--- a/noncore/todayplugins/stockticker/libstocks/csv.c
+++ b/noncore/todayplugins/stockticker/libstocks/csv.c
@@ -305,25 +305,26 @@ stock *parse_csv_history_file(char *csv_file)
305 int test; 305 int test;
306 306
307 stock *StockPtr=NULL; 307 stock *StockPtr=NULL;
308 stock *LastStockPtr=NULL; 308 stock *LastStockPtr=NULL;
309 309
310 /* Used to return the pointer to the list */ 310 /* Used to return the pointer to the list */
311 stock *FirstStockPtr=NULL; 311 stock *FirstStockPtr=NULL;
312 312
313 line = csv_file; 313 line = csv_file;
314 end_line = csv_file; 314 end_line = csv_file;
315 315
316 /* do not use the first line */ 316 /* do not use the first line */
317 end_line = strstr(line, "\n"); 317 if (!(end_line = strstr(line, "\n")))
318 return 0;
318 *end_line = 0; 319 *end_line = 0;
319 end_line++; 320 end_line++;
320 line = end_line; 321 line = end_line;
321 322
322 while ((end_line = strstr(line, "\n"))) 323 while ((end_line = strstr(line, "\n")))
323 { 324 {
324 *end_line = 0; 325 *end_line = 0;
325 326
326 StockPtr = malloc_stock(); 327 StockPtr = malloc_stock();
327 328
328 /* Date */ 329 /* Date */
329 ptr = strtok(line, ","); 330 ptr = strtok(line, ",");