[SCM] kodi-pvr-vdr-vnsi/master: requestpacket: convert runtime check to assertion

tiber-guest at users.alioth.debian.org tiber-guest at users.alioth.debian.org
Sun Feb 28 15:46:50 UTC 2016


The following commit has been merged in the master branch:
commit aa19a26439e69072f37f5eb6d070e0f8f1a4a5b7
Author: Max Kellermann <max at duempel.org>
Date:   Sat Nov 7 23:00:59 2015 +0100

    requestpacket: convert runtime check to assertion
    
    It's illegal to reinitialize a cRequestPacket instance, and this is
    a software bug, not a runtime error.

diff --git a/src/requestpacket.cpp b/src/requestpacket.cpp
index b66f9bb..d37ded8 100644
--- a/src/requestpacket.cpp
+++ b/src/requestpacket.cpp
@@ -24,6 +24,7 @@
 #include "tools.h"
 #include "platform/sockets/tcp.h"
 
+#include <assert.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -46,7 +47,7 @@ cRequestPacket::~cRequestPacket()
 
 bool cRequestPacket::init(uint32_t topcode, bool stream, bool setUserDataLength, size_t userDataLength)
 {
-  if (buffer) return false;
+  assert(buffer == NULL);
 
   if (setUserDataLength)
   {

-- 
kodi-pvr-vdr-vnsi packaging



More information about the pkg-multimedia-commits mailing list