Nullpointer removed

This commit is contained in:
2018-06-07 08:30:37 +02:00
parent 6632cb4d9a
commit 70f0b6f94a
2 changed files with 2 additions and 2 deletions

View File

@ -195,7 +195,7 @@ string read_line(FILE* file) {
char *line = nullptr; char *line = nullptr;
size_t len = 0; size_t len = 0;
ssize_t read; ssize_t read;
if ((read = getline(&line, &len, file)) < 0) { if ((read = getline(&line, &len, file)) < 0 || line == nullptr) {
return ""; return "";
} }
string l = string(line); string l = string(line);

View File

@ -576,7 +576,7 @@ long Socket::select(list<Socket> read, list<Socket> write, long millis) {
FD_SET(s.fd, &writefd); FD_SET(s.fd, &writefd);
} }
struct timeval *tv; struct timeval *tv = new struct timeval;
if (millis < 0) { if (millis < 0) {
tv = nullptr; tv = nullptr;
} else if (millis == 0) { } else if (millis == 0) {