[libpri-commits] rmudgett: branch 1.4 r914 - in /branches/1.4: pri_internal.h q931.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Fri Jun 26 13:37:19 CDT 2009


Author: rmudgett
Date: Fri Jun 26 13:37:15 2009
New Revision: 914

URL: http://svn.asterisk.org/svn-view/libpri?view=rev&rev=914
Log:
Added printf format attribute to pri_message() and pri_error() and fixed some detected errors.

Modified:
    branches/1.4/pri_internal.h
    branches/1.4/q931.c

Modified: branches/1.4/pri_internal.h
URL: http://svn.asterisk.org/svn-view/libpri/branches/1.4/pri_internal.h?view=diff&rev=914&r1=913&r2=914
==============================================================================
--- branches/1.4/pri_internal.h (original)
+++ branches/1.4/pri_internal.h Fri Jun 26 13:37:15 2009
@@ -287,9 +287,8 @@
 
 extern pri_event *pri_mkerror(struct pri *pri, char *errstr);
 
-extern void pri_message(struct pri *pri, char *fmt, ...);
-
-extern void pri_error(struct pri *pri, char *fmt, ...);
+void pri_message(struct pri *ctrl, char *fmt, ...) __attribute__((format(printf, 2, 3)));
+void pri_error(struct pri *ctrl, char *fmt, ...) __attribute__((format(printf, 2, 3)));
 
 void libpri_copy_string(char *dst, const char *src, size_t size);
 

Modified: branches/1.4/q931.c
URL: http://svn.asterisk.org/svn-view/libpri/branches/1.4/q931.c?view=diff&rev=914&r1=913&r2=914
==============================================================================
--- branches/1.4/q931.c (original)
+++ branches/1.4/q931.c Fri Jun 26 13:37:15 2009
@@ -682,7 +682,8 @@
 					(data & 0x04)?1:0,
 					(data & 0x02)?1:0);
 			} else {
-				pri_message(ctrl, "%c                                Unknown octet 5b: 0x%x\n", data );
+				pri_message(ctrl, "%c                                Unknown octet 5b: 0x%x\n",
+					prefix, data);
 			}
 			pos++;
 		}
@@ -1970,12 +1971,13 @@
 	type = ie->data[0] & 0x1F;
 	pri_message(ctrl, "%c Generic Digits (len=%02d): Encoding %s  Type %s\n", prefix, len, gdencoding2str(encoding), gdtype2str(type));
 	if (encoding == 3) {	/* Binary */
-		pri_message(ctrl, "%c                            Don't know how to handle binary encoding\n");
+		pri_message(ctrl, "%c                            Don't know how to handle binary encoding\n",
+			prefix);
 		return;
 	}
 	if (len == 3)	/* No number information */
 		return;
-	pri_message(ctrl, "%c                            Digits: ");
+	pri_message(ctrl, "%c                            Digits: ", prefix);
 	value = 0;
 	for(idx = 3; idx < len; ++idx) {
 		switch(encoding) {




More information about the libpri-commits mailing list