aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-06-20 15:35:26 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-06-20 15:35:26 +0200
commit6f0e357e1aa69a885de2267b699c51fe3c1ce698 (patch)
treeb23a519c20c33adf41b1147d5e3430d0708cbeff
parent1484540dfdd6e71bd04c437f2a1218914822c17b (diff)
downloadODR-PadEnc-6f0e357e1aa69a885de2267b699c51fe3c1ce698.tar.gz
ODR-PadEnc-6f0e357e1aa69a885de2267b699c51fe3c1ce698.tar.bz2
ODR-PadEnc-6f0e357e1aa69a885de2267b699c51fe3c1ce698.zip
Add check for readdir for DT_UNKNOWN
-rw-r--r--src/mot-encoder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mot-encoder.cpp b/src/mot-encoder.cpp
index e227412..cc451e6 100644
--- a/src/mot-encoder.cpp
+++ b/src/mot-encoder.cpp
@@ -218,7 +218,7 @@ int main(int argc, char *argv[])
while(1) {
pDir = opendir(dir);
if (pDir == NULL) {
- printf ("Cannot open directory '%s'\n", dir);
+ fprintf(stderr, "Cannot open directory '%s'\n", dir);
return 1;
}
if (fidx == 9999) {
@@ -226,7 +226,7 @@ int main(int argc, char *argv[])
}
while ((pDirent = readdir(pDir)) != NULL) {
- if (pDirent->d_name[0] != '.') {
+ if (pDirent->d_type != DT_UNKNOWN && pDirent->d_name[0] != '.') {
sprintf(imagepath, "%s/%s", dir, pDirent->d_name);
ret = encodeFile(output_fd, imagepath, fidx, padlen);
if (ret != 1) {