mirror of https://github.com/aria2/aria2
Fixed segmentation fault if fp_ is NULL
parent
e86fd44dc5
commit
79fce29bda
|
@ -55,11 +55,11 @@ BufferedFile::BufferedFile(const char* filename, const char* mode)
|
|||
fp_(a2fopen(filename, mode)),
|
||||
#endif // !__MINGW32__
|
||||
open_(fp_),
|
||||
supportsColor_(isatty(fileno(fp_)))
|
||||
supportsColor_(fp_ ? isatty(fileno(fp_)) : false)
|
||||
{}
|
||||
|
||||
BufferedFile::BufferedFile(FILE* fp)
|
||||
: fp_(fp), open_(true), supportsColor_(isatty(fileno(fp)))
|
||||
: fp_(fp), open_(true), supportsColor_(fp_ ? isatty(fileno(fp_)) : false)
|
||||
{}
|
||||
|
||||
BufferedFile::~BufferedFile()
|
||||
|
|
Loading…
Reference in New Issue