mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
Add some error messages to csv_conv.c (#132)
This commit is contained in:
1 parent
82112d8638
commit
2ba8c031be
1 file changed
+15
Vendored
+15
@@ -481,10 +481,25 @@ static CsvLines RemoveAllBackslashRs(CsvLines lines)
|
||||
MapRegions CsvToBinaryData(char *csv_file_data, long csv_file_size, char *bin_path, TokenList tokens, bool outputBinaryFile)
|
||||
{
|
||||
MapRegions mapRegions = {0};
|
||||
|
||||
if(csv_file_data == NULL) {
|
||||
fprintf(stderr, "ERROR(%s,%d): csv_file_data is nullptr\n", __FILE__, __LINE__);
|
||||
return mapRegions;
|
||||
}
|
||||
|
||||
if(csv_file_size == 0) {
|
||||
fprintf(stderr, "ERROR(%s,%d): csv_file_size is 0\n", __FILE__, __LINE__);
|
||||
return mapRegions;
|
||||
}
|
||||
|
||||
CsvLines lines = GetCsvLines(csv_file_data, csv_file_size);
|
||||
lines = RemoveAllBackslashRs(lines);
|
||||
|
||||
if(lines.list == NULL) {
|
||||
fprintf(stderr, "ERROR(%s,%d): lines.list is NULL", __FILE__, __LINE__);
|
||||
return mapRegions;
|
||||
}
|
||||
|
||||
char *header = lines.list[0];
|
||||
|
||||
char *ident = strtok(header, ",");
|
||||
|
||||
Reference in new issue
Block a user