Changed logging to refuse to log char*, they are just unsafe.
This commit is contained in:
1 parent
a54aa1dbdb
commit
a06a94fdcf
8 files changed
+26
-13
No files matched your search
@@ -38,7 +38,7 @@ bool SocketConnection::connect ()
|
||||
LOG (Jetfix,Error,
|
||||
"Failed to allocate socket when connecting to {}:{} errno:{} msg: {}",
|
||||
_cfg.socket_connect_host_ip (), _cfg.socket_connect_port (),
|
||||
er, strerror_r(er,msg,sizeof(msg)));
|
||||
er, std::string(strerror_r(er,msg,sizeof(msg))));
|
||||
_fd = -1;
|
||||
return false;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ int SocketConnection::read (char* to_buffer,size_t read_count)
|
||||
auto er = errno;
|
||||
char msg [256];
|
||||
LOG (Jetfix,Warn,"Could not read from jetfix connection. {}",
|
||||
strerror_r(er,msg,sizeof(msg)));
|
||||
std::string(strerror_r(er,msg,sizeof(msg))));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ int SocketConnection::write (WriteVec const&vec,size_t vec_size,size_t cid)
|
||||
auto er = errno;
|
||||
char msg [256];
|
||||
LOG (Jetfix,Warn,"Could not write to jetfix connection. ",
|
||||
strerror_r(er,msg,sizeof(msg)));
|
||||
std::string(strerror_r(er,msg,sizeof(msg))));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user