Skip to content

Commit

Permalink
make compiler happier
Browse files Browse the repository at this point in the history
  • Loading branch information
TLeconte committed Jul 16, 2022
1 parent 36ad4ba commit 304cd31
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions netout.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ void Netoutpp(acarsmsg_t * msg)
{
char pkt[3600]; // max. 16 blocks * 220 characters + extra space for msg prefix
char *pstr;
int res;

char *txt = strdup(msg->txt);
for (pstr = txt; *pstr != 0; pstr++)
Expand All @@ -90,14 +91,15 @@ void Netoutpp(acarsmsg_t * msg)
msg->mode, msg->addr, msg->ack, msg->label, msg->bid ? msg->bid : '.', msg->no,
msg->fid, txt);

write(sockfd, pkt, strlen(pkt));
res=write(sockfd, pkt, strlen(pkt));
free(txt);
}

void Netoutsv(acarsmsg_t * msg, char *idstation, int chn, struct timeval tv)
{
char pkt[3600]; // max. 16 blocks * 220 characters + extra space for msg prefix
struct tm tmp;
int res;

gmtime_r(&(tv.tv_sec), &tmp);

Expand All @@ -108,15 +110,16 @@ void Netoutsv(acarsmsg_t * msg, char *idstation, int chn, struct timeval tv)
msg->err, (int)(msg->lvl), msg->mode, msg->addr, msg->ack, msg->label,
msg->bid ? msg->bid : '.', msg->no, msg->fid, msg->txt);

write(sockfd, pkt, strlen(pkt));
res=write(sockfd, pkt, strlen(pkt));
}

void Netoutjson(char *jsonbuf)
{
char pkt[3600];
int res;

snprintf(pkt, sizeof(pkt), "%s\n", jsonbuf);
write(sockfd, pkt, strlen(pkt));
res=write(sockfd, pkt, strlen(pkt));
}


0 comments on commit 304cd31

Please sign in to comment.