Added printf format attribute to pri_message() and pri_error() and fixed some detected errors.

git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@914 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Richard Mudgett
2009-06-26 18:37:15 +00:00
parent 562e1fb7ca
commit 24cc37a839
2 changed files with 7 additions and 6 deletions

View File

@@ -287,9 +287,8 @@ extern void pri_schedule_del(struct pri *pri, int ev);
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);

8
q931.c
View File

@@ -682,7 +682,8 @@ static void dump_bearer_capability(int full_ie, struct pri *ctrl, q931_ie *ie, i
(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 @@ static void dump_generic_digits(int full_ie, struct pri *ctrl, q931_ie *ie, int
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) {