summaryrefslogtreecommitdiff
path: root/apps/app_sms.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_sms.c')
-rw-r--r--apps/app_sms.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/app_sms.c b/apps/app_sms.c
index e94a63d1e..385f47978 100644
--- a/apps/app_sms.c
+++ b/apps/app_sms.c
@@ -783,7 +783,7 @@ static void sms_log(sms_t * h, char status)
unsigned char n;
if (h->mr >= 0) {
- snprintf(mrs, sizeof(mrs), "%02X", (unsigned)h->mr);
+ snprintf(mrs, sizeof(mrs), "%02hhX", (unsigned char)h->mr);
}
snprintf(line, sizeof(line), "%s %c%c%c%s %s %s %s ",
isodate(time(NULL), buf, sizeof(buf)),
@@ -1016,7 +1016,7 @@ static void sms_writefile(sms_t * h)
unsigned int p;
fprintf(o, "udh#");
for (p = 0; p < h->udhl; p++) {
- fprintf(o, "%02X", (unsigned)h->udh[p]);
+ fprintf(o, "%02hhX", (unsigned char)h->udh[p]);
}
fprintf(o, "\n");
}
@@ -1049,7 +1049,7 @@ static void sms_writefile(sms_t * h)
if (p == h->udl) { /* can write in ucs-1 hex */
fprintf(o, "ud#");
for (p = 0; p < h->udl; p++) {
- fprintf(o, "%02X", (unsigned)h->ud[p]);
+ fprintf(o, "%02hhX", (unsigned char)h->ud[p]);
}
fprintf(o, "\n");
} else { /* write in UCS-2 */
@@ -1140,7 +1140,7 @@ static unsigned char sms_handleincoming (sms_t * h)
return 0xFF; /* duh! */
}
} else {
- ast_log(LOG_WARNING, "Unknown message type %02X\n", (unsigned)h->imsg[2]);
+ ast_log(LOG_WARNING, "Unknown message type %02hhX\n", h->imsg[2]);
return 0xFF;
}
} else { /* client */
@@ -1163,7 +1163,7 @@ static unsigned char sms_handleincoming (sms_t * h)
return 0xFF; /* duh! */
}
} else {
- ast_log(LOG_WARNING, "Unknown message type %02X\n", (unsigned)h->imsg[2]);
+ ast_log(LOG_WARNING, "Unknown message type %02hhX\n", h->imsg[2]);
return 0xFF;
}
}
@@ -1245,7 +1245,7 @@ static char *sms_hexdump(unsigned char buf[], int size, char *s /* destination *
int f;
for (p = s, f = 0; f < size && f < MAX_DEBUG_LEN; f++, p += 3) {
- sprintf(p, "%02X ", (unsigned)buf[f]);
+ sprintf(p, "%02hhX ", (unsigned char)buf[f]);
}
return(s);
}
@@ -1483,7 +1483,7 @@ static void sms_debug (int dir, sms_t *h)
int n = (dir == DIR_RX) ? h->ibytep : msg[1] + 2;
int q = 0;
while (q < n && q < 30) {
- sprintf(p, " %02X", (unsigned)msg[q++]);
+ sprintf(p, " %02hhX", msg[q++]);
p += 3;
}
if (q < n) {