Nullpointer removed
This commit is contained in:
@ -195,7 +195,7 @@ string read_line(FILE* file) {
|
||||
char *line = nullptr;
|
||||
size_t len = 0;
|
||||
ssize_t read;
|
||||
if ((read = getline(&line, &len, file)) < 0) {
|
||||
if ((read = getline(&line, &len, file)) < 0 || line == nullptr) {
|
||||
return "";
|
||||
}
|
||||
string l = string(line);
|
||||
|
@ -576,7 +576,7 @@ long Socket::select(list<Socket> read, list<Socket> write, long millis) {
|
||||
FD_SET(s.fd, &writefd);
|
||||
}
|
||||
|
||||
struct timeval *tv;
|
||||
struct timeval *tv = new struct timeval;
|
||||
if (millis < 0) {
|
||||
tv = nullptr;
|
||||
} else if (millis == 0) {
|
||||
|
Reference in New Issue
Block a user