diff --git a/src/lib/java_string.cpp b/src/lib/java_string.cpp index a96fe9d..4d9d2c7 100644 --- a/src/lib/java_string.cpp +++ b/src/lib/java_string.cpp @@ -14,7 +14,7 @@ //If not, see https://www.gnu.org/licenses/agpl-3.0.en.html #include -#include +#include #include "error.h++" #include "java_string.h++" @@ -23,20 +23,19 @@ namespace JavaCompat { //FIXME: contrary to what I said, we need to explicitly pass the data // size because files could have been tampered with or corrupted tiny_utf8::string importJavaString(uint8_t data[]) { - std::vector output; - tiny_utf8::string outputString; + std::string stdString; uint16_t size = static_cast(data[0])<<8 | static_cast(data[1]); for(uint8_t i=2; i exportJavaString(tiny_utf8::string data) { diff --git a/src/test/java_string.cpp b/src/test/java_string.cpp index 5e7cef5..9bd2ab9 100644 --- a/src/test/java_string.cpp +++ b/src/test/java_string.cpp @@ -52,7 +52,7 @@ int main(){ return 2; } - tiny_utf8::string importedString = JavaCompat::importJavaFormat(reinterpret_cast(javaStdString.data())); + tiny_utf8::string importedString = JavaCompat::importJavaString(reinterpret_cast(javaStdString.data())); std::streampos normalSize; std::string normalStdString;