[Asterisk-cvs] libpri q931.c,1.108,1.109
markster at lists.digium.com
markster at lists.digium.com
Wed Jan 26 23:37:13 CST 2005
Update of /usr/cvsroot/libpri
In directory mongoose.digium.com:/tmp/cvs-serv8045
Modified Files:
q931.c
Log Message:
Fix generic digit byte order (bug #2788)
Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri/q931.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- q931.c 25 Jan 2005 00:36:34 -0000 1.108
+++ q931.c 27 Jan 2005 05:39:17 -0000 1.109
@@ -1595,11 +1595,11 @@
switch(encoding) {
case 0: /* BCD even */
case 1: /* BCD odd */
- pri_message("%d", (ie->data[idx-2] >> 4) & 0x0f);
- value = value * 10 + ((ie->data[idx-2] >> 4) & 0x0f);
+ pri_message("%d", ie->data[idx-2] & 0x0f);
+ value = value * 10 + (ie->data[idx-2] & 0x0f);
if(!encoding || (idx+1 < len)) { /* Special handling for BCD odd */
- pri_message("%d", ie->data[idx-2] & 0x0f);
- value = value * 10 + (ie->data[idx-2] & 0x0f);
+ pri_message("%d", (ie->data[idx-2] >> 4) & 0x0f);
+ value = value * 10 + ((ie->data[idx-2] >> 4) & 0x0f);
}
break;
case 2: /* IA5 */
@@ -1645,9 +1645,9 @@
switch(encoding) {
case 0: /* BCD even */
case 1: /* BCD odd */
- value = value * 10 + ((ie->data[idx-2] >> 4) & 0x0f);
+ value = value * 10 + (ie->data[idx-2] & 0x0f);
if(!encoding || (idx+1 < len)) /* Special handling for BCD odd */
- value = value * 10 + (ie->data[idx-2] & 0x0f);
+ value = value * 10 + ((ie->data[idx-2] >> 4) & 0x0f);
break;
case 2: /* IA5 */
value = value * 10 + (ie->data[idx-2] - '0');
More information about the svn-commits
mailing list