From 039e9abef5e9f1a9c0c9f7cfb59b599bebc30955 Mon Sep 17 00:00:00 2001 From: "jazz (gitea)" Date: Mon, 9 Mar 2026 13:00:46 -0500 Subject: [PATCH] update modified-example.cc to match new column limit --- modified-example.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modified-example.cc b/modified-example.cc index 5dd636f..6868ec4 100644 --- a/modified-example.cc +++ b/modified-example.cc @@ -86,8 +86,9 @@ displayFile(string path, int startLineNum = 0, int numLines = 10) // print each line directly to the screen int num = 0; - while (getline(file, line) && num <= numLines + startLineNum + 1) // while there is file content and the - // line number isn't too high + while (getline(file, line) && + num <= numLines + startLineNum + 1) // while there is file content and the + // line number isn't too high { if (num >= startLineNum) { move(lineNum, 0); @@ -132,7 +133,8 @@ void * waitForClient(void *argss) { waitClientArgs *args = static_cast(argss); - clientSocketDescriptor = accept(serverSocketDescriptor, (sockaddr *)&args->newSockAddr, &args->newSockAddrSize); + clientSocketDescriptor = + accept(serverSocketDescriptor, (sockaddr *)&args->newSockAddr, &args->newSockAddrSize); if (clientSocketDescriptor >= 0) { writeToFile(logFileName, "client connected"); if (linesInFile(logFileName) > LOG_LENGTH) @@ -184,7 +186,8 @@ setupServer(int port) exit(0); } // bind the socket to its local address - int bindStatus = bind(serverSocketDescriptor, (struct sockaddr *)&servAddr, sizeof(servAddr)); + int bindStatus = + bind(serverSocketDescriptor, (struct sockaddr *)&servAddr, sizeof(servAddr)); if (bindStatus < 0) { // keeps from bricking the terminal if this happens endwin(); @@ -288,7 +291,8 @@ setupClient() sendSockAddr.sin_port = htons(PORT_NUM); clientSocketDescriptor = socket(AF_INET, SOCK_STREAM, 0); // try to connect... - int status = connect(clientSocketDescriptor, (sockaddr *)&sendSockAddr, sizeof(sendSockAddr)); + int status = + connect(clientSocketDescriptor, (sockaddr *)&sendSockAddr, sizeof(sendSockAddr)); if (status < 0) writeToFile(logFileName, "Error connecting to socket!"); writeToFile(logFileName, "Connected to the server!");