Not only was this function needlessly convoluted, it was also broken - since it returned a bool value where an error code was expected.
Not only was this function needlessly convoluted, it was also broken - since it returned a bool value where an error code was expected.