Skip to content

Commit

Permalink
Replace assert with error
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusTomlinson committed Jan 9, 2024
1 parent a442ccf commit 8cb20f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <Common.h>

#include <assert.h>
#include <iostream>
#include <mutex>

Expand Down Expand Up @@ -120,7 +119,11 @@ Client::Client( const std::filesystem::path& socketPath )
}
#endif

assert( p->socketPath.length() <= sizeof( sockaddr_un::sun_path ) );
if ( p->socketPath.length() > sizeof( sockaddr_un::sun_path ) )
{
std::cerr << "socket path too long: " << socketPath << std::endl;
return;
}

memset( &p->socketAddr, 0, sizeof( p->socketAddr ) );
p->socketAddr.sun_family = AF_UNIX;
Expand Down
1 change: 0 additions & 1 deletion src/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <Common.h>
#include <Message.h>

#include <assert.h>
#include <iostream>

using namespace Ipc;
Expand Down

0 comments on commit 8cb20f3

Please sign in to comment.