Fix _priv->fp malloc & strcpy

This commit is contained in:
Pradana AUMARS 2021-06-29 23:37:41 +02:00
parent a8480a2fcf
commit 0354afb2b7

View File

@ -728,9 +728,9 @@ _easycsv_priv_init(const char *fp,
size_t stfp = strlen(fp); size_t stfp = strlen(fp);
/* Allocate memory for char* */ /* 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 */ /* Calculate rows and cols if file exists */
if (access(_priv->fp, F_OK) == 0) { if (access(_priv->fp, F_OK) == 0) {