Fix segfault in prt-cache
Co-authored-by: Alexandr Savca <alexandr.savca89@gmail.com>
This commit is contained in:
parent
da6bfb0a60
commit
8bc31c0745
@ -1806,6 +1806,11 @@ void PrtGet::ls()
|
||||
if ( p ) {
|
||||
string dirname = p->path() + "/" + p->name();
|
||||
DIR* dir = opendir(dirname.c_str());
|
||||
if (dir == NULL) {
|
||||
cerr << "Directory " << dirname << " not found" << endl;
|
||||
m_returnValue = PG_GENERAL_ERROR;
|
||||
return;
|
||||
}
|
||||
struct dirent* entry;
|
||||
vector<string> files;
|
||||
while ((entry = readdir(dir))) {
|
||||
@ -1848,7 +1853,7 @@ void PrtGet::cat()
|
||||
}
|
||||
string file = p->path() + "/" + p->name() + "/" + fileName;
|
||||
if (!printFile(file)) {
|
||||
cerr << "File '" << *it << "' not found" << endl;
|
||||
cerr << "File '" << fileName << "' not found" << endl;
|
||||
m_returnValue = PG_GENERAL_ERROR;
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user