[libpri-commits] trunk - r269 /trunk/q931.c

libpri-commits at lists.digium.com libpri-commits at lists.digium.com
Wed Nov 30 16:42:41 CST 2005


Author: mattf
Date: Wed Nov 30 16:42:40 2005
New Revision: 269

URL: http://svn.digium.com/view/libpri?rev=269&view=rev
Log:
Allow receival of single digit keypad facility IEs.  Was broken before.

Modified:
    trunk/q931.c

Modified: trunk/q931.c
URL: http://svn.digium.com/view/libpri/trunk/q931.c?rev=269&r1=268&r2=269&view=diff
==============================================================================
--- trunk/q931.c (original)
+++ trunk/q931.c Wed Nov 30 16:42:40 2005
@@ -1382,12 +1382,14 @@
 	if (ie->len == 0)
 		return -1;
 
-	if (ie->len > sizeof(call->digitbuf))
-		mylen = sizeof(call->digitbuf);
+	if (ie->len > (sizeof(call->digitbuf) - 1))
+		mylen = (sizeof(call->digitbuf) - 1);
 	else
 		mylen = ie->len;
 
-	libpri_copy_string(call->digitbuf, (char *) ie->data, mylen);
+	memcpy(call->digitbuf, ie->data, mylen);
+
+	call->digitbuf[mylen] = 0;
 
 	return 0;
 }



More information about the libpri-commits mailing list