X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/559d32bc2789dc69a7c19598a31f485c6caaff11..db7b9b78524bcdd1f2a5d82c1696bcd2f96d9491:/projects/stargazer/plugins/other/smux/types.cpp?ds=sidebyside diff --git a/projects/stargazer/plugins/other/smux/types.cpp b/projects/stargazer/plugins/other/smux/types.cpp index 14117ce5..eb09a73c 100644 --- a/projects/stargazer/plugins/other/smux/types.cpp +++ b/projects/stargazer/plugins/other/smux/types.cpp @@ -5,7 +5,7 @@ #include "types.h" -bool ParseArcs(const char * str, size_t length, unsigned * a, size_t * pos) +bool ParseArcs(const char * str, ptrdiff_t length, unsigned * a, size_t * pos) { if (length == 0) return false; @@ -53,12 +53,14 @@ return true; } OID::OID(const std::string & str) + : arcs() { if (!StringToArcs(str.c_str(), str.length(), arcs)) throw std::runtime_error("Invalid oid"); } OID::OID(const char * str, size_t length) + : arcs() { if (!StringToArcs(str, length, arcs)) throw std::runtime_error("Invalid oid"); @@ -70,12 +72,14 @@ OID::OID(const std::vector & a) } OID::OID(const unsigned * a, size_t length) + : arcs() { std::vector newArcs(a, a + length); arcs.swap(newArcs); } OID::OID(OBJECT_IDENTIFIER_t * oid) + : arcs() { unsigned a[1024]; int count = OBJECT_IDENTIFIER_get_arcs(oid, a, sizeof(a[0]), 1024);