Explorar el Código

Fixed rtcIsOpen() and rtcIsClosed() return value for invalid channel

Paul-Louis Ageneau hace 3 años
padre
commit
a3b9d27b86
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/capi.cpp

+ 2 - 2
src/capi.cpp

@@ -676,11 +676,11 @@ int rtcSendMessage(int id, const char *data, int size) {
 }
 
 bool rtcIsOpen(int id) {
-	return wrap([id] { return getChannel(id)->isOpen(); });
+	return wrap([id] { return getChannel(id)->isOpen() ? 0 : 1; }) == 0 ? true : false;
 }
 
 bool rtcIsClosed(int id) {
-	return wrap([id] { return getChannel(id)->isClosed(); });
+	return wrap([id] { return getChannel(id)->isClosed() ? 0 : 1; }) == 0 ? true : false ;
 }
 
 int rtcGetBufferedAmount(int id) {