Browse Source

Fix _priv->fp malloc & strcpy

redesign
Pradana AUMARS 11 months ago
parent
commit
0354afb2b7
  1. 4
      src/easycsv.c

4
src/easycsv.c

@ -728,9 +728,9 @@ _easycsv_priv_init(const char *fp,
size_t stfp = strlen(fp);
/* Allocate memory for char* */
// priv->fp = malloc(stfp + 1); // + 1 for null
_priv->fp = malloc(stfp + 1); // + 1 for null
// strncpy(_priv->fp, fp, stfp);
strcpy(_priv->fp, fp);
/* Calculate rows and cols if file exists */
if (access(_priv->fp, F_OK) == 0) {

Loading…
Cancel
Save