summaryrefslogtreecommitdiff
path: root/csv.c
AgeCommit message (Collapse)Author
2021-09-08test-csv: test handling of trailing NUL byteHeinrich Schuchardt
Data after a NUL byte should be ignored. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-09-08csv: detect end of csv file correctlyHeinrich Schuchardt
.sbat sections contain user supplied data. We should not assume that it is well formed. The last line feed might be missing or it might not be at the end of the file. Instead one or more \0 might follow. In parse_csv_data() variable 'line' is a pointer with a value between the values of 'data' and 'data_end'. There is no reason to check that it is non-zero after assigning it from 'data' as we already check 'data'. Instead at the beginning of the file and after each line we must check that we have not reached the end of the file marked by a '\0' character. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-03-30sbat: add more dprint()Peter Jones
This adds dprint() to a bunch of our error returns. Signed-off-by: Peter Jones <pjones@redhat.com>
2021-03-10Consolidate most of our standard lib functions to libPeter Jones
Signed-off-by: Peter Jones <pjones@redhat.com>
2021-02-25Add a stand-alone CSV parser.Peter Jones
This adds a simple to use, one-function-call CSV parser that takes a blob of data and gives you a linked list with an array of values. Signed-off-by: Peter Jones <pjones@redhat.com>