From 633b483e1b0e63ad7cde149c83865fa409b4fb4a Mon Sep 17 00:00:00 2001 From: leslie Date: Mon, 11 Aug 2008 20:11:55 +0800 Subject: [PATCH] constcw: proper type cast --- systems/constcw/constcw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/systems/constcw/constcw.c b/systems/constcw/constcw.c index e6c6003..901c307 100644 --- a/systems/constcw/constcw.c +++ b/systems/constcw/constcw.c @@ -19,9 +19,7 @@ #include #include -#include #include -#include #include #include @@ -120,7 +118,8 @@ bool cSystemConstCw::ProcessECM(const cEcmInfo *ecm, unsigned char *source) cKeySnoop ks(this,'X',ecm->caId,0); cPlainKey *pk=0; while((pk=keys.FindKey('X',ecm->caId,0,16,pk))) { - if(typeid(*pk)==typeid(cPlainKeyConstCw) && ((cPlainKeyConstCw *)pk)->Matches(ecm)) { + cPlainKeyConstCw *ck=dynamic_cast(pk); // downcast + if(ck && ck->Matches(ecm)) { pk->Get(cw); ks.OK(pk); return true; -- 2.39.5