/* If the requested operation results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeChar8Add(IN CHAR8 Augend, IN CHAR8 Addend, OUT CHAR8 *Result)
/* If the requested operation results in an overflow or an underflow condition, then Result is set to CHAR8_ERROR and RETURN_BUFFER_TOO_SMALL is returned. */
RETURN_STATUS EFIAPI SafeChar8Add(IN CHAR8 Augend, IN CHAR8 Addend, OUT CHAR8 *Result)
{
  INT32  Augend32;
  INT32  Addend32;
  if (Result == NULL) {
    return RETURN_INVALID_PARAMETER;
  }
  Augend32 = (INT32)Augend;
  Addend32 = (INT32)Addend;
  if ((Augend32 < 0) || (Augend32 > MAX_INT8)) {
    *Result = CHAR8_ERROR;
    return RETURN_BUFFER_TOO_SMALL;
  }
  if ((Addend32 < 0) || (Addend32 > MAX_INT8)) {
    *Result = CHAR8_ERROR;
    return RETURN_BUFFER_TOO_SMALL;
  }
  return SafeInt32ToChar8 (Augend32 + Addend32, Result);
}