diff options
Diffstat (limited to 'NK_C_API.cc')
-rw-r--r-- | NK_C_API.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc index 6f4c757..704feec 100644 --- a/NK_C_API.cc +++ b/NK_C_API.cc @@ -4,6 +4,7 @@ #include <cstring> #include "include/LibraryException.h" #include "include/cxx_semantics.h" +#include "version.h" #ifdef _MSC_VER #ifdef _WIN32 @@ -99,6 +100,7 @@ uint8_t get_without_result(T func){ } + #ifdef __cplusplus extern "C" { #endif @@ -533,7 +535,12 @@ extern "C" { NK_C_API const char * NK_version() { - return VERSION; + auto m = NitrokeyManager::instance(); + return get_with_string_result([&](){ + const std::string & s = Version::version; + char * rs = strndup(s.c_str(), max_string_field_length); + return rs; + }); } #ifdef __cplusplus |