diff options
Diffstat (limited to 'channels')
-rw-r--r-- | channels/misdn/ie.c | 4 | ||||
-rw-r--r-- | channels/misdn_config.c | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/channels/misdn/ie.c b/channels/misdn/ie.c index fbd06d163..dc9802845 100644 --- a/channels/misdn/ie.c +++ b/channels/misdn/ie.c @@ -1347,7 +1347,7 @@ static void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, ch i = 0; while(i < user_len) { - if (MISDN_IE_DEBG) printf(debug+(i*3), " %02x", user[i]); + if (MISDN_IE_DEBG) sprintf(debug+(i*3), " %02x", user[i]); i++; } @@ -1393,7 +1393,7 @@ static void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, ch i = 0; while(i < *user_len) { - if (MISDN_IE_DEBG) printf(debug+(i*3), " %02x", user[i]); + if (MISDN_IE_DEBG) sprintf(debug+(i*3), " %02x", user[i]); i++; } debug[i*3] = '\0'; diff --git a/channels/misdn_config.c b/channels/misdn_config.c index 12a742cf3..29723e17c 100644 --- a/channels/misdn_config.c +++ b/channels/misdn_config.c @@ -882,12 +882,14 @@ static int _parse (union misdn_cfg_pt *dest, const char *value, enum misdn_cfg_t break; case MISDN_CTYPE_INT: { - char *pat; - if (strchr(value,'x')) - pat="%x"; - else - pat="%d"; - if (sscanf(value, pat, &tmp)) { + int res; + + if (strchr(value,'x')) { + res = sscanf(value, "%x", &tmp); + } else { + res = sscanf(value, "%d", &tmp); + } + if (res) { dest->num = ast_malloc(sizeof(int)); memcpy(dest->num, &tmp, sizeof(int)); } else |