2
0

Update Java to match C's internal changes.

This commit is contained in:
Maarten Billemont
2017-09-19 13:45:51 -04:00
parent 70c784db83
commit 35c0431cec
42 changed files with 589 additions and 3034 deletions

View File

@@ -50,14 +50,11 @@ const MPResultType mpw_typeWithName(const char *typeName) {
return MPResultTypeDeriveKey;
}
// Lower-case and trim optionally leading "Generated" string from typeName to standardize it.
size_t stdTypeNameOffset = 0;
// Lower-case typeName to standardize it.
size_t stdTypeNameSize = strlen( typeName );
if (strstr( typeName, "Generated" ) == typeName)
stdTypeNameSize -= (stdTypeNameOffset = strlen( "Generated" ));
char stdTypeName[stdTypeNameSize + 1];
for (size_t c = 0; c < stdTypeNameSize; ++c)
stdTypeName[c] = (char)tolower( typeName[c + stdTypeNameOffset] );
stdTypeName[c] = (char)tolower( typeName[c] );
stdTypeName[stdTypeNameSize] = '\0';
// Find what password type is represented by the type name.