8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 02:03:04 +01:00

Fix little issue in temp stuff noted by Claudio Valderrama

This commit is contained in:
skidder 2003-05-11 17:12:08 +00:00
parent 7e67e95915
commit af0bc3449f

View File

@ -26,6 +26,7 @@
* 2002.10.29 Sean Leyne - Removed obsolete "Netware" port
*
* 2002.10.30 Sean Leyne - Removed support for obsolete "PC_PLATFORM" define
* 2003.05.11 Nickolay Samofatov - rework temp stuff
*
*/
@ -2261,7 +2262,7 @@ void * API_ROUTINE gds__temp_file(
else
directory = WORKFILE;
}
if (strlen(directory) >= MAXPATHLEN-strlen(string)-strlen(TEMP_PATTERN)-1)
if (strlen(directory) >= MAXPATHLEN-strlen(string)-strlen(TEMP_PATTERN)-2)
return (void *)-1;
void *result;
@ -2303,7 +2304,7 @@ void * API_ROUTINE gds__temp_file(
if (!directory && !(directory = getenv("INTERBASE_TMP")) && !(directory = getenv("TMP")))
directory = WORKFILE;
TEXT file_name[MAXPATHLEN];
if (strlen(directory) >= MAXPATHLEN-strlen(string)-strlen(TEMP_PATTERN)-1)
if (strlen(directory) >= MAXPATHLEN-strlen(string)-strlen(TEMP_PATTERN)-2)
return (void *)-1;
strcpy(file_name, directory);
if (file_name[strlen(file_name)-1] != '/')