Skip to content

Commit

Permalink
fix -Wformat-overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-naumov committed May 2, 2024
1 parent 9120d74 commit c9508e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ int main(int argc, char **argv)
*ap = '-';
if (strlen(socknamebuf) > FILENAME_MAX)
socknamebuf[FILENAME_MAX - 1] = 0;
sprintf(SocketPath + strlen(SocketPath), "/%s", socknamebuf);
snprintf(SocketPath + strlen(SocketPath), sizeof(SocketPath) - strlen(SocketPath), "/%s", socknamebuf);
SET_GUID();
Attacher();
/* NOTREACHED */
Expand Down Expand Up @@ -993,7 +993,7 @@ int main(int argc, char **argv)
if (strlen(socknamebuf) > FILENAME_MAX) {
socknamebuf[FILENAME_MAX] = 0;
}
sprintf(SocketPath + strlen(SocketPath), "/%s", socknamebuf);
snprintf(SocketPath + strlen(SocketPath), sizeof(SocketPath) - strlen(SocketPath), "/%s", socknamebuf);

ServerSocket = MakeServerSocket();
#ifdef SYSTEM_SCREENRC
Expand Down

0 comments on commit c9508e0

Please sign in to comment.