[libss7-commits] rmudgett: branch group/new-API r306 - /team/group/new-API/

SVN commits to the libss7 project libss7-commits at lists.digium.com
Thu Jul 19 12:59:26 CDT 2012


Author: rmudgett
Date: Thu Jul 19 12:59:22 2012
New Revision: 306

URL: http://svnview.digium.com/svn/libss7?view=rev&rev=306
Log:
  r305 | rmudgett | 2012-07-19 12:47:19 -0500 (Thu, 19 Jul 2012) | 4 lines

  * Add printf attributes to ss7_message() and ss7_error().

  * Fix a format string parameter mismatch.

Modified:
    team/group/new-API/isup.c
    team/group/new-API/mtp3.c
    team/group/new-API/ss7.c
    team/group/new-API/ss7_internal.h

Modified: team/group/new-API/isup.c
URL: http://svnview.digium.com/svn/libss7/team/group/new-API/isup.c?view=diff&rev=306&r1=305&r2=306
==============================================================================
--- team/group/new-API/isup.c (original)
+++ team/group/new-API/isup.c Thu Jul 19 12:59:22 2012
@@ -3027,7 +3027,7 @@
 
 	ss7_message(ss7, "\t\tCIC: %d\n", cic);
 	ss7_dump_buf(ss7, 2, buf, 2);
-	ss7_message(ss7, "\t\tMessage Type: %s\n", message2str(mh->type), mh->type & 0xff);
+	ss7_message(ss7, "\t\tMessage Type: %s(0x%02x)\n", message2str(mh->type), mh->type & 0xff);
 	ss7_dump_buf(ss7, 2, &buf[2], 1);
 
 	/* Find us in the message list */
@@ -5010,7 +5010,7 @@
 		ss7_message(ss7, "ISUP timer %s (%ims) started on CIC %i DPC %i\n", buf, ss7->isup_timers[timer], c->cic, c->dpc);
 		return 0;
 	} else
-		ss7_error(ss7, "Unable to start ISUP timer %s on CIC %i DPC %i\n", buf, ss7->isup_timers[timer], c->cic, c->dpc);
+		ss7_error(ss7, "Unable to start ISUP timer %s on CIC %d DPC %d\n", buf, c->cic, c->dpc);
 
 	return -1;
 }

Modified: team/group/new-API/mtp3.c
URL: http://svnview.digium.com/svn/libss7/team/group/new-API/mtp3.c?view=diff&rev=306&r1=305&r2=306
==============================================================================
--- team/group/new-API/mtp3.c (original)
+++ team/group/new-API/mtp3.c Thu Jul 19 12:59:22 2012
@@ -1130,7 +1130,8 @@
 			return 0;
 		case NET_MNG_COA:
 			if (!(winner->got_sent_netmsg & (SENT_COO | SENT_ECO))) {
-				ss7_error(ss7, "Got COA on SLC %i PC %i but we haven't sent COO or ECO\n");
+				ss7_error(ss7, "Got COA on SLC %d ADJPC %d but we haven't sent COO or ECO\n",
+					winner->slc, winner->dpc);
 				return -1;
 			}
 			if (winner->mtp3_timer[MTP3_TIMER_T2] > -1) {

Modified: team/group/new-API/ss7.c
URL: http://svnview.digium.com/svn/libss7/team/group/new-API/ss7.c?view=diff&rev=306&r1=305&r2=306
==============================================================================
--- team/group/new-API/ss7.c (original)
+++ team/group/new-API/ss7.c Thu Jul 19 12:59:22 2012
@@ -76,7 +76,7 @@
 	ss7_call_null = func;
 }
 
-void ss7_message(struct ss7 *ss7, char *fmt, ...)
+void ss7_message(struct ss7 *ss7, const char *fmt, ...)
 {
 	char tmp[1024];
 	va_list ap;
@@ -90,7 +90,7 @@
 		fputs(tmp, stdout);
 }
 
-void ss7_error(struct ss7 *ss7, char *fmt, ...)
+void ss7_error(struct ss7 *ss7, const char *fmt, ...)
 {
 	char tmp[1024];
 	va_list ap;

Modified: team/group/new-API/ss7_internal.h
URL: http://svnview.digium.com/svn/libss7/team/group/new-API/ss7_internal.h?view=diff&rev=306&r1=305&r2=306
==============================================================================
--- team/group/new-API/ss7_internal.h (original)
+++ team/group/new-API/ss7_internal.h Thu Jul 19 12:59:22 2012
@@ -160,9 +160,8 @@
 
 void ss7_msg_userpart_len(struct ss7_msg *m, int len);
 
-void ss7_message(struct ss7 *ss7, char *fmt, ...);
-
-void ss7_error(struct ss7 *ss7, char *fmt, ...);
+void ss7_message(struct ss7 *ss7, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
+void ss7_error(struct ss7 *ss7, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
 
 void ss7_dump_buf(struct ss7 *ss7, int tabs,  unsigned char *buf, int len);
 




More information about the libss7-commits mailing list