
Comparación de Cadenas strcmp
Publicado por FREDDY (2 intervenciones) el 12/12/2016 21:05:56
Hola Chicos
Tengo una gran duda con respecto a esta sentencia
Tengo el siguiente parametro
plazo[3] producto[2] shcerr[0] lenDE57 [9] DE57[00203003] ,pos_condition_code[-32745],MyShcmsg->msgtype[100],MyShcmsg->txnDest[05]
El valor a evaluar es: MyShcmsg->txnDest[05] pero como veran no ingresa a la condición
Este es la validación completa:
Cuando se ejecuta me arroja a:
[12/12/2016 14:37]
16.12.10 11:37:18 [ shc:20185220]1er Condition Tj.International Plazo<>0
16.12.10 11:37:18 [ shc:20185220]MyShcmsg->txnDest[05]
txnDest es un char[10]
Alguna idea que puede estar pasando??
Tengo una gran duda con respecto a esta sentencia
1
2
3
4
5
6
7
if ((strcmp(MyShcmsg->txnDest, "04") == 0 ||strcmp(MyShcmsg->txnDest, "05") == 0))
{
ODebug("E-CDR-CB: Negando TXN, Plazo no soportado para BIN no local\n");
MyShcmsg->respcode = SHC_RC_InvalidTransaction;
return ( SHCCALLBACKDENY );
}else{ODebug("MyShcmsg->txnDest[%s]\n",MyShcmsg->txnDest);
}
Tengo el siguiente parametro
plazo[3] producto[2] shcerr[0] lenDE57 [9] DE57[00203003] ,pos_condition_code[-32745],MyShcmsg->msgtype[100],MyShcmsg->txnDest[05]
El valor a evaluar es: MyShcmsg->txnDest[05] pero como veran no ingresa a la condición
Este es la validación completa:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
ODebug("1er Condition Tj.International Plazo<>0 \n");
if (plazo !=0){
if (MyShcmsg->msgtype == 100){
if (MyShcmsg->respcode == 0){
if (MyShcmsg->pos_condition_code & SH_POS_COND_CREDIT_TXN){
if ((strcmp(MyShcmsg->txnDest, "04") == 0 ||strcmp(MyShcmsg->txnDest, "05") == 0))
{
ODebug("E-CDR-CB: Negando TXN, Plazo no soportado para BIN no local\n");
MyShcmsg->respcode = SHC_RC_InvalidTransaction;
return ( SHCCALLBACKDENY );
}else{ODebug("MyShcmsg->txnDest[%s]\n",MyShcmsg->txnDest);}
}else{ODebug("MyShcmsg->pos_condition_code[%d]\n",MyShcmsg->pos_condition_code);}
}else{ODebug("MyShcmsg->respcode[%i]\n",MyShcmsg->respcode);}
}else{ODebug("MyShcmsg->msgtype[%i]\n",MyShcmsg->msgtype);}
}else{ODebug("plazo[%d]\n",plazo);}
Cuando se ejecuta me arroja a:
[12/12/2016 14:37]
16.12.10 11:37:18 [ shc:20185220]1er Condition Tj.International Plazo<>0
16.12.10 11:37:18 [ shc:20185220]MyShcmsg->txnDest[05]
txnDest es un char[10]
Alguna idea que puede estar pasando??
Valora esta pregunta


0