Correct initialization would be -
struct Error
{
byte code;
boolean active;
char msg[21];
};
struct ErrorStates
{
Error ERR_A;
Error ERR_B;
};
ErrorStates errors =
{
{ 1, false, { "some error" } }
, { 2, false, { "some other error" } }
};
When initializing arrays C++ will fill unprovided data with the last value you do provide. In this case you're using C character string syntax which automatically provides a trailing zero so the remainder of the array should be initialized with the trailing zero.