Skip to content

Commit

Permalink
Minor little updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrady committed Dec 18, 2017
1 parent 61f212f commit dcb928d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dacp.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ static void response_body(void *opaque, const char *data, int size) {

ssize_t space_available = response->malloced_size - response->size;
if (space_available < size) {
printf("Getting more space for the response -- need %d bytes but only %d bytes left.\n", size,
debug(1,"Getting more space for the response -- need %d bytes but only %ld bytes left.\n", size,
size - space_available);
ssize_t size_requested = size - space_available + response->malloced_size + 16384;
void *t = realloc(response->body, size_requested);
response->malloced_size = size_requested;
if (t)
response->body = t;
else {
printf("Can't allocate any more space for parser.\n");
debug(1,"Can't allocate any more space for parser.\n");
exit(-1);
}
}
Expand Down Expand Up @@ -305,7 +305,7 @@ void *dacp_monitor_thread_code(void *na) {
printf(" (0x");
t = sp - item_size;
for (i = 0; i < item_size; i++) {
printf("%02x", *t);
printf("%02x", *t&0xff);
t++;
}
printf(")");
Expand All @@ -331,11 +331,11 @@ void *dacp_monitor_thread_code(void *na) {
t += 4;
v = (ntohl(*(uint32_t *)(t))) & 0xffffffff;
s += v;
printf(" %llu", s);
printf(" %lu", s);
printf(" (0x");
t = sp - item_size;
for (i = 0; i < item_size; i++) {
printf("%02x", *t);
printf("%02x", *t&0xff);
t++;
}
printf(")");
Expand All @@ -344,7 +344,7 @@ void *dacp_monitor_thread_code(void *na) {
printf(" 0x");
t = sp - item_size;
for (i = 0; i < item_size; i++) {
printf("%02x", *t);
printf("%02x", *t&0xff);
t++;
}
break;
Expand Down

0 comments on commit dcb928d

Please sign in to comment.