* Changed how the string for the UUID hash is build.
* Accidently did not start at different positions in the string to build the hash, but just added some value to the hash... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28112 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -318,19 +318,21 @@ main(int argc, char *argv[])
|
|||||||
strcpy(fullPath, "Haiku");
|
strcpy(fullPath, "Haiku");
|
||||||
|
|
||||||
if (realpath(file, fullPath + 5) == NULL)
|
if (realpath(file, fullPath + 5) == NULL)
|
||||||
strncpy(fullPath, file, sizeof(fullPath));
|
strncpy(fullPath + 5, file, sizeof(fullPath) - 5);
|
||||||
|
|
||||||
for (size_t i = strlen(fullPath); i < sizeof(fullPath) - 1; i++) {
|
size_t pathLength = strlen(fullPath);
|
||||||
|
for (size_t i = pathLength; i < 42; i++) {
|
||||||
// fill rest with some numbers
|
// fill rest with some numbers
|
||||||
fullPath[i] = i % 10 + '0';
|
fullPath[i] = i % 10 + '0';
|
||||||
}
|
}
|
||||||
fullPath[sizeof(fullPath) - 1] = '\0';
|
if (pathLength < 42)
|
||||||
|
fullPath[42] = '\0';
|
||||||
|
|
||||||
uuid1 = hash_string(fullPath);
|
uuid1 = hash_string(fullPath);
|
||||||
uuid2 = hash_string(fullPath) + 5;
|
uuid2 = hash_string(fullPath + 5);
|
||||||
uuid3 = hash_string(fullPath) + 13;
|
uuid3 = hash_string(fullPath + 13);
|
||||||
uuid4 = hash_string(fullPath) + 19;
|
uuid4 = hash_string(fullPath + 19);
|
||||||
uuid5 = hash_string(fullPath) + 29;
|
uuid5 = hash_string(fullPath + 29);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create embedded descriptor
|
// Create embedded descriptor
|
||||||
|
|||||||
Reference in New Issue
Block a user