Fix malloc size
This commit is contained in:
parent
f97f364681
commit
6199dc4a12
@ -201,7 +201,7 @@ easycsv_init_errormsg(const char *fp,
|
|||||||
csv->start = clock();
|
csv->start = clock();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
easycsv *csv = malloc(sizeof *csv);
|
easycsv *csv = malloc(sizeof(csv));
|
||||||
csv->mode = mode;
|
csv->mode = mode;
|
||||||
csv->_priv = _easycsv_priv_init(fp, mode, error);
|
csv->_priv = _easycsv_priv_init(fp, mode, error);
|
||||||
|
|
||||||
@ -687,7 +687,7 @@ _easycsv_priv_init(const char *fp,
|
|||||||
const EASYCSV_MODE mode,
|
const EASYCSV_MODE mode,
|
||||||
const EASYCSV_ERRORMSG error)
|
const EASYCSV_ERRORMSG error)
|
||||||
{
|
{
|
||||||
_easycsv *_priv = malloc(sizeof *_priv);
|
_easycsv *_priv = malloc(sizeof(_easycsv));
|
||||||
memset(_priv, 0, sizeof(*_priv)); // set all members to NULL or 0
|
memset(_priv, 0, sizeof(*_priv)); // set all members to NULL or 0
|
||||||
|
|
||||||
_priv->error = error;
|
_priv->error = error;
|
||||||
|
Loading…
Reference in New Issue
Block a user