mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-25 00:43:03 +01:00
style, better asserts - thanks to Claudio
This commit is contained in:
parent
c5d8a8dfe7
commit
d6d4a30671
@ -3588,14 +3588,22 @@ static void safe_concat_path(TEXT *resultString, const TEXT *appendString)
|
||||
*
|
||||
**************************************/
|
||||
size_t len = strlen(resultString);
|
||||
if (resultString[len - 1] != PathUtils::dir_sep && len < MAXPATHLEN - 1) {
|
||||
if (resultString[len - 1] != PathUtils::dir_sep && len < MAXPATHLEN - 1)
|
||||
{
|
||||
resultString[len++] = PathUtils::dir_sep;
|
||||
resultString[len] = 0;
|
||||
}
|
||||
|
||||
size_t alen = strlen(appendString);
|
||||
if (len + alen > MAXPATHLEN - 1)
|
||||
{
|
||||
alen = MAXPATHLEN - 1 - len;
|
||||
fb_assert(len + alen <= MAXPATHLEN);
|
||||
}
|
||||
|
||||
fb_assert(len < MAXPATHLEN);
|
||||
fb_assert(alen < MAXPATHLEN);
|
||||
fb_assert(len + alen < MAXPATHLEN);
|
||||
|
||||
memcpy(&resultString[len], appendString, alen);
|
||||
resultString[len + alen] = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user