In easycsv_print_columns/rows, check NULL pointer
Signed-off-by: Pradana AUMARS <paumars@courrier.dev>
This commit is contained in:
parent
679160e208
commit
006cd346e9
@ -240,13 +240,23 @@ easycsv_read_value(const easycsv *csv,
|
|||||||
int
|
int
|
||||||
easycsv_print_rows(const easycsv *csv)
|
easycsv_print_rows(const easycsv *csv)
|
||||||
{
|
{
|
||||||
return csv->rows;
|
if (csv != NULL) {
|
||||||
|
return csv->rows;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
easycsv_print_columns(const easycsv *csv)
|
easycsv_print_columns(const easycsv *csv)
|
||||||
{
|
{
|
||||||
return csv->cols;
|
if (csv != NULL) {
|
||||||
|
return csv->cols;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** Modifications, sort ***/
|
/*** Modifications, sort ***/
|
||||||
|
Loading…
Reference in New Issue
Block a user