Eina: Fix mistake in a previous patch

Suffix length was not computed properly.
Also, the change on eina_mkstemps was a @feature:
add file extension support when creating temporary files
This commit is contained in:
Jean-Philippe Andre 2014-04-02 12:43:58 +09:00
parent dcca057213
commit e50bcc937c
1 changed files with 2 additions and 2 deletions

View File

@ -919,9 +919,9 @@ eina_file_mkstemp(const char *templatename, Eina_Tmpstr **path)
* http://man7.org/linux/man-pages/man3/mkstemp.3.html#NOTES * http://man7.org/linux/man-pages/man3/mkstemp.3.html#NOTES
*/ */
old_umask = umask(S_IRWXG|S_IRWXO); old_umask = umask(S_IRWXG|S_IRWXO);
if ((XXXXXX = strstr(templatename, "XXXXXX.")) != NULL) if ((XXXXXX = strstr(buffer, "XXXXXX.")) != NULL)
{ {
int suffixlen = templatename + len - XXXXXX - 6; int suffixlen = buffer + len - XXXXXX - 6;
fd = mkstemps(buffer, suffixlen); fd = mkstemps(buffer, suffixlen);
} }
else else