Skip to content

Commit

Permalink
Fix 32-bit compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
orgads committed Sep 11, 2024
1 parent 9812bd1 commit fdc0c97
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1563,8 +1563,8 @@ char * call::get_last_header(const char * name)
if (name[len - 1] == ':') {
return get_header(last_recv_msg, name, false);
} else {
char with_colon[MAX_HEADER_LEN];
sprintf(with_colon, "%s:", name);
char with_colon[MAX_HEADER_LEN+2];
snprintf(with_colon, MAX_HEADER_LEN+2, "%s:", name);
return get_header(last_recv_msg, with_colon, false);
}
}
Expand Down Expand Up @@ -1604,8 +1604,8 @@ char * call::get_last_request_uri()
}

last_request_uri[0] = '\0';
if (tmp && (tmp_len > 0)) {
strncpy(last_request_uri, tmp, tmp_len);
if (tmp_len > 0) {
memcpy(last_request_uri, tmp, tmp_len);
}
last_request_uri[tmp_len] = '\0';

Expand Down
10 changes: 6 additions & 4 deletions src/rtpstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2702,7 +2702,7 @@ void rtpstream_audioecho_thread(void* param)
pthread_mutex_lock(&debugremutexaudio);
if (debugrefileaudio != nullptr)
{
fprintf(debugrefileaudio, "DATA SUCCESSFULLY RECEIVED [AUDIO] nr = %ld...", nr);
fprintf(debugrefileaudio, "DATA SUCCESSFULLY RECEIVED [AUDIO] nr = %d...", int(nr));
}
for (int i = 0; i < 12; i++)
{
Expand Down Expand Up @@ -2780,7 +2780,8 @@ void rtpstream_audioecho_thread(void* param)
pthread_mutex_lock(&debugremutexaudio);
if (debugrefileaudio != nullptr)
{
fprintf(debugrefileaudio, "DATA SUCCESSFULLY SENT [AUDIO] seq_num = [%u] -- MISMATCHED RECV/SENT BYTE COUNT -- errno = %d nr = %ld ns = %ld\n", seq_num, errno, nr, ns);
fprintf(debugrefileaudio, "DATA SUCCESSFULLY SENT [AUDIO] seq_num = [%u] -- MISMATCHED RECV/SENT BYTE COUNT -- errno = %d nr = %d ns = %d\n",
seq_num, errno, int(nr), int(ns));
}
pthread_mutex_unlock(&debugremutexaudio);
} else {
Expand Down Expand Up @@ -2961,7 +2962,7 @@ void rtpstream_videoecho_thread(void* param)
pthread_mutex_lock(&debugremutexvideo);
if (debugrefilevideo != nullptr)
{
fprintf(debugrefilevideo, "DATA SUCCESSFULLY RECEIVED [VIDEO] nr = %ld...", nr);
fprintf(debugrefilevideo, "DATA SUCCESSFULLY RECEIVED [VIDEO] nr = %d...", int(nr));
}
for (int i = 0; i < 12; i++)
{
Expand Down Expand Up @@ -3038,7 +3039,8 @@ void rtpstream_videoecho_thread(void* param)
pthread_mutex_lock(&debugremutexvideo);
if (debugrefilevideo != nullptr)
{
fprintf(debugrefilevideo, "DATA SUCCESSFULLY SENT [VIDEO] seq_num = [%u] -- MISMATCHED RECV/SENT BYTE COUNT -- errno = %d nr = %ld ns = %ld\n", seq_num, errno, nr, ns);
fprintf(debugrefilevideo, "DATA SUCCESSFULLY SENT [VIDEO] seq_num = [%u] -- MISMATCHED RECV/SENT BYTE COUNT -- errno = %d nr = %d ns = %d\n",
seq_num, errno, int(nr), int(ns));
}
pthread_mutex_unlock(&debugremutexvideo);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/sip_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ static const char* internal_find_header(const char* msg, const char* name, const
ptr = strchr(ptr, '\n');
if (!ptr || ptr[-1] != '\r' || (ptr[1] == '\r' && ptr[2] == '\n')) {
if (ptr && ptr[-1] != '\r') {
WARNING("Missing CR during header scan at pos %ld", ptr - msg);
WARNING("Missing CR during header scan at pos %d", int(ptr - msg));
/* continue? */
}
return nullptr;
Expand Down

0 comments on commit fdc0c97

Please sign in to comment.