diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-07-06 18:29:15 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2014-07-06 18:29:15 +0200 |
commit | 82731b30832b61e7d4e26497f6236327be291f0e (patch) | |
tree | c357619237b2ae0382d6c746bd1dafb92499eb29 /src/mot-encoder.cpp | |
parent | 34c7950e6849c63b7a7b0e1c9c2a9fab48244f22 (diff) | |
download | ODR-PadEnc-82731b30832b61e7d4e26497f6236327be291f0e.tar.gz ODR-PadEnc-82731b30832b61e7d4e26497f6236327be291f0e.tar.bz2 ODR-PadEnc-82731b30832b61e7d4e26497f6236327be291f0e.zip |
mot-encoder: only close directory if slideshow is active
Diffstat (limited to 'src/mot-encoder.cpp')
-rw-r--r-- | src/mot-encoder.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mot-encoder.cpp b/src/mot-encoder.cpp index 1a5ca1e..63b639c 100644 --- a/src/mot-encoder.cpp +++ b/src/mot-encoder.cpp @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) { int len, fidx, ret; struct dirent *pDirent; - DIR *pDir; + DIR *pDir = NULL; int padlen = 58; bool erase_after_tx = false; int sleepdelay = 10; @@ -318,7 +318,9 @@ int main(int argc, char *argv[]) sleep(sleepdelay); - closedir(pDir); + if (pDir) { + closedir(pDir); + } } return 1; } |