Browse Source

Fix malloc size

redesign
Pradana AUMARS 4 months ago
parent
commit
6199dc4a12
  1. 4
      src/easycsv.c

4
src/easycsv.c

@ -201,7 +201,7 @@ easycsv_init_errormsg(const char *fp,
csv->start = clock();
#endif
easycsv *csv = malloc(sizeof *csv);
easycsv *csv = malloc(sizeof(csv));
csv->mode = mode;
csv->_priv = _easycsv_priv_init(fp, mode, error);
@ -687,7 +687,7 @@ _easycsv_priv_init(const char *fp,
const EASYCSV_MODE mode,
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
_priv->error = error;

Loading…
Cancel
Save