edi_file: use a static buffer for the path.

This commit is contained in:
Al Poole 2017-09-28 01:39:49 +01:00
parent c826dee557
commit 3eadca948c
1 changed files with 3 additions and 3 deletions

View File

@ -20,9 +20,10 @@ edi_file_path_hidden(const char *path)
void
edi_file_text_replace(const char *path, const char *search, const char *replace)
{
char *map, *tempfilepath, *found;
char *map, *found;
FILE *tempfile;
Eina_File *f;
char tempfilepath[PATH_MAX];
unsigned long long len, idx;
unsigned int slen;
@ -43,8 +44,7 @@ edi_file_text_replace(const char *path, const char *search, const char *replace)
return;
}
tempfilepath = malloc(strlen(path)) + 5;
sprintf(tempfilepath, "/tmp/%s.tmp", ecore_file_file_get(path));
snprintf(tempfilepath, sizeof(tempfilepath), "/tmp/%s.tmp", ecore_file_file_get(path));
tempfile = fopen(tempfilepath, "wb");
if (!tempfile) goto done;