Fix _priv->fp malloc & strcpy
This commit is contained in:
parent
a8480a2fcf
commit
0354afb2b7
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user