diff --git a/lib/BasicsC/conversions.c b/lib/BasicsC/conversions.c index fa5c51b062..4ea31ccded 100644 --- a/lib/BasicsC/conversions.c +++ b/lib/BasicsC/conversions.c @@ -379,8 +379,8 @@ size_t TRI_StringInt8InPlace (int8_t attr, char* buffer) { char* p; if (attr == INT8_MIN) { - memcpy(buffer, "-128\0", 4); - return 3; + memcpy(buffer, "-128\0", 5); + return 4; } p = buffer; diff --git a/lib/BasicsC/files.c b/lib/BasicsC/files.c index 7df66f58c5..bbf1b3581b 100644 --- a/lib/BasicsC/files.c +++ b/lib/BasicsC/files.c @@ -179,12 +179,10 @@ static void RemoveAllLockedFiles (void) { for (i = 0; i < FileNames._length; i++) { TRI_UnlinkFile(FileNames._buffer[i]); - TRI_RemoveVectorString(&FileNames, i); fd = * (int*) TRI_AtVector(&FileDescriptors, i); TRI_CLOSE(fd); - TRI_RemoveVector(&FileDescriptors, i); } TRI_DestroyVectorString(&FileNames); @@ -405,7 +403,7 @@ bool TRI_ExistsFile (char const* path) { /// @brief creates a directory, recursively //////////////////////////////////////////////////////////////////////////////// -bool TRI_CreateRecursiveDirectory (char const* path) { +int TRI_CreateRecursiveDirectory (char const* path) { char* copy; char* p; char* s; @@ -1492,7 +1490,6 @@ char* TRI_GetAbsolutePath (char const* file, char const* cwd) { char* TRI_LocateBinaryPath (char const* argv0) { char const* p; - char* dir; char* binaryPath = NULL; size_t i; @@ -1504,15 +1501,11 @@ char* TRI_LocateBinaryPath (char const* argv0) { // contains a path if (*p) { - dir = TRI_Dirname(argv0); + binaryPath = TRI_Dirname(argv0); - if (dir == 0) { + if (binaryPath == 0) { binaryPath = TRI_DuplicateString(""); } - else { - binaryPath = TRI_DuplicateString(dir); - TRI_FreeString(TRI_CORE_MEM_ZONE, dir); - } } // check PATH variable diff --git a/lib/BasicsC/files.h b/lib/BasicsC/files.h index 99d1da5199..bc056c36c3 100644 --- a/lib/BasicsC/files.h +++ b/lib/BasicsC/files.h @@ -91,7 +91,7 @@ bool TRI_ExistsFile (char const* path); /// @brief creates a directory, recursively //////////////////////////////////////////////////////////////////////////////// -bool TRI_CreateRecursiveDirectory (char const* path); +int TRI_CreateRecursiveDirectory (char const* path); //////////////////////////////////////////////////////////////////////////////// /// @brief creates a directory diff --git a/lib/BasicsC/structures.c b/lib/BasicsC/structures.c index 7b2766693e..b030d4120b 100644 --- a/lib/BasicsC/structures.c +++ b/lib/BasicsC/structures.c @@ -89,8 +89,6 @@ TRI_blob_t* TRI_CopyBlob (TRI_memory_zone_t* zone, TRI_blob_t const* src) { return NULL; } - dst->length = src->length; - if (src->length == 0 || src->data == NULL) { dst->length = 0; dst->data = NULL; @@ -115,8 +113,6 @@ TRI_blob_t* TRI_CopyBlob (TRI_memory_zone_t* zone, TRI_blob_t const* src) { //////////////////////////////////////////////////////////////////////////////// int TRI_CopyToBlob (TRI_memory_zone_t* zone, TRI_blob_t* dst, TRI_blob_t const* src) { - dst->length = src->length; - if (src->length == 0 || src->data == NULL) { dst->length = 0; dst->data = NULL; diff --git a/lib/BasicsC/win-utils.c b/lib/BasicsC/win-utils.c index 4749d8c351..1e9fe5189f 100644 --- a/lib/BasicsC/win-utils.c +++ b/lib/BasicsC/win-utils.c @@ -45,7 +45,7 @@ // ............................................................................. -// Some global variables which may be required throughtout the lifetime of the +// Some global variables which may be required throughout the lifetime of the // server // .............................................................................