From f39a8abc2293ad73a490552227c37f079c0f4e19 Mon Sep 17 00:00:00 2001 From: Stefan Pöschel Date: Wed, 23 Aug 2017 17:13:34 +0200 Subject: Improve perror usage --- src/sls.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/sls.cpp') diff --git a/src/sls.cpp b/src/sls.cpp index aa0167f..f059114 100644 --- a/src/sls.cpp +++ b/src/sls.cpp @@ -121,7 +121,7 @@ bool SlideStore::InitFromDir(const std::string& dir) { struct dirent** dir_entries; int dir_count = scandir(dir.c_str(), &dir_entries, FilterSlides, alphasort); if(dir_count < 0) { - perror("ODR-PadEnc Error: cannot open slides directory"); + perror(("ODR-PadEnc Error: cannot open slides directory '" + dir + "'").c_str()); return false; } @@ -462,8 +462,7 @@ bool SLSManager::encodeFile(const std::string& fname, int fidx, bool raw_slides) // read file FILE* pFile = fopen(fname.c_str(), "rb"); if (pFile == NULL) { - fprintf(stderr, "ODR-PadEnc Error: Unable to load file '%s'\n", - fname.c_str()); + perror(("ODR-PadEnc Error: Unable to load file '" + fname + "'").c_str()); goto encodefile_out; } -- cgit v1.2.3