Compare commits

...

2 Commits

Author SHA1 Message Date
f052d8630d
libos: Use Vector::shallow_copy() in ArgumentParser
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-19 12:23:56 +02:00
8542cf7cbf
libluna: Fix Vector::shallow_copy() 2023-06-19 12:23:39 +02:00
2 changed files with 2 additions and 2 deletions

View File

@ -212,7 +212,7 @@ template <typename T> class Vector
{ {
Vector<T> other; Vector<T> other;
TRY(other.try_reserve(m_capacity)); TRY(other.try_reserve(m_capacity));
memcpy(other.m_data, m_data, m_size); memcpy(other.m_data, m_data, m_size * sizeof(T));
other.m_size = m_size; other.m_size = m_size;
return other; return other;
} }

View File

@ -118,7 +118,7 @@ namespace os
bool is_still_parsing_flags = true; bool is_still_parsing_flags = true;
Vector<PositionalArgument> positional_args = TRY(m_positional_args.deep_copy()); Vector<PositionalArgument> positional_args = TRY(m_positional_args.shallow_copy());
for (int i = 1; i < argc; i++) for (int i = 1; i < argc; i++)
{ {