diff --git a/libs/main/core/pistring.cpp b/libs/main/core/pistring.cpp index c5e5c3e5..578d949a 100644 --- a/libs/main/core/pistring.cpp +++ b/libs/main/core/pistring.cpp @@ -333,11 +333,14 @@ PIString PIString::fromAscii(const char * s) { ret.push_back(PIChar(s[l])); ++l; } - /*while (s[l] != '\0') ++l; + return ret; +} + + +PIString PIString::fromAscii(const char * s, int len) { PIString ret; - ret.resize(l); - for (int i = 0; i < l; ++i) - ret[i] = s[i];*/ + for (int l = 0; l < len; ++l) + ret.push_back(PIChar(s[l])); return ret; } diff --git a/libs/main/core/pistring.h b/libs/main/core/pistring.h index 75e06b46..455ad87d 100644 --- a/libs/main/core/pistring.h +++ b/libs/main/core/pistring.h @@ -722,6 +722,9 @@ public: //! \brief Return string constructed from ASCII static PIString fromAscii(const char * s); + //! \brief Return string constructed from "len" chars ASCII + static PIString fromAscii(const char * s, int len); + //! \brief Return string constructed from "c" codepage static PIString fromCodepage(const char * s, const char * c); diff --git a/libs/main/system/piplugin.cpp b/libs/main/system/piplugin.cpp index e93f6b37..3d6686c3 100644 --- a/libs/main/system/piplugin.cpp +++ b/libs/main/system/piplugin.cpp @@ -56,7 +56,7 @@ * If you using user version check, you should set it * with macro \a PIP_PLUGIN_SET_USER_VERSION(version). * When plugin is successfully loaded and checked, - * you can load your custom cymbols with function + * you can load your custom symbols with function * \a resolve(name), similar to PILibrary. * \note You should use PIP_PLUGIN_EXPORT and "export "C"" * with functions you want to use with \a resolve(name)!