Skip to content

Commit

Permalink
#1617 fix warning: 'sprintf' is deprecated from macOS (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
calvin2021y authored Aug 4, 2023
1 parent 7568327 commit 3bb917d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AsyncSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ struct AsyncSocket {
unsigned char *b = (unsigned char *) binary.data();

if (binary.length() == 4) {
ipLength = sprintf(buf, "%u.%u.%u.%u", b[0], b[1], b[2], b[3]);
ipLength = snprintf(buf, 64, "%u.%u.%u.%u", b[0], b[1], b[2], b[3]);
} else {
ipLength = sprintf(buf, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
ipLength = snprintf(buf, 64, "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11],
b[12], b[13], b[14], b[15]);
}
Expand Down

0 comments on commit 3bb917d

Please sign in to comment.