Skip to content

Commit

Permalink
fix(fjage.c) : converting sprintf to snprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
notthetup committed Dec 6, 2023
1 parent 7af81a6 commit febaec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gateways/c/src/fjage.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ static bool json_process(fjage_gw_t gw, char* json, const char* id) {
}
} else {
char s[256];
sprintf(s, "{\"id\": \"%s\", \"inResponseTo\": \"%s\", \"answer\": false}\n", json_gets(json, tokens, "id"), action);
writes(fgw->sockfd, s);
int l = snprintf(s, 256, "{\"id\": \"%s\", \"inResponseTo\": \"%s\", \"answer\": false}\n", json_gets(json, tokens, "id"), action);
if (l < 256) writes(fgw->sockfd, s);
}
}
free(tokens);
Expand Down

0 comments on commit febaec7

Please sign in to comment.