forked from enlightenment/edi
edi_file: use a static buffer for the path.
This commit is contained in:
parent
c826dee557
commit
3eadca948c
|
@ -20,9 +20,10 @@ edi_file_path_hidden(const char *path)
|
||||||
void
|
void
|
||||||
edi_file_text_replace(const char *path, const char *search, const char *replace)
|
edi_file_text_replace(const char *path, const char *search, const char *replace)
|
||||||
{
|
{
|
||||||
char *map, *tempfilepath, *found;
|
char *map, *found;
|
||||||
FILE *tempfile;
|
FILE *tempfile;
|
||||||
Eina_File *f;
|
Eina_File *f;
|
||||||
|
char tempfilepath[PATH_MAX];
|
||||||
unsigned long long len, idx;
|
unsigned long long len, idx;
|
||||||
unsigned int slen;
|
unsigned int slen;
|
||||||
|
|
||||||
|
@ -43,8 +44,7 @@ edi_file_text_replace(const char *path, const char *search, const char *replace)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tempfilepath = malloc(strlen(path)) + 5;
|
snprintf(tempfilepath, sizeof(tempfilepath), "/tmp/%s.tmp", ecore_file_file_get(path));
|
||||||
sprintf(tempfilepath, "/tmp/%s.tmp", ecore_file_file_get(path));
|
|
||||||
|
|
||||||
tempfile = fopen(tempfilepath, "wb");
|
tempfile = fopen(tempfilepath, "wb");
|
||||||
if (!tempfile) goto done;
|
if (!tempfile) goto done;
|
||||||
|
|
Loading…
Reference in New Issue