libmapper: Actually examine read errors
Don't rely on undefined behavior in failed read calls where some of the
message is read. Right now the subtree remove callback parses the message
of type "as" into a 1 element array. It uses this to determine if the
array is empty or not. This depends on the underlying implementation to
populate one of the array elements in the case where it has more than
one and produces an error.
Instead, properly enter the array container and check to see if it is empty
while doing error handling for the calls.
Change-Id: I542c488524a5dce5466d6196879159d888e47346
Signed-off-by: William A. Kennington III <wak@google.com>
1 file changed