Skip to content
Snippets Groups Projects
Commit c290acf7 authored by rswindell's avatar rswindell
Browse files

csvReadFile() rewinds file.

#include string.h for strdup() prototype.
parent fc00dde3
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@
#include "csv_file.h"
#include "genwrap.h" /* lastchar */
#include <stdlib.h> /* malloc */
#include <string.h> /* strdup */
char* csvEncode(char* field)
{
......@@ -190,6 +191,8 @@ str_list_t* csvReadFile(FILE* fp, str_list_t* columns)
str_list_t lines;
size_t i;
rewind(fp);
if((lines=strListReadFile(fp, NULL, 0))==NULL)
return(NULL);
......@@ -231,7 +234,7 @@ int main()
printf("%s\n",list[i]);
}
#elif 1 /* decode and display .csv file */
#elif 0 /* decode and display .csv file */
void main(int argc, char** argv)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment