From 07af96b3a783ccc5679b0cc0ab7b4046e03ac3de Mon Sep 17 00:00:00 2001 From: Loic Le Loarer Date: Thu, 16 Jul 2015 01:20:03 +0200 Subject: [PATCH] Use perror for error report --- src/tools/uchardet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/uchardet.cpp b/src/tools/uchardet.cpp index b78bab2..6ea5131 100644 --- a/src/tools/uchardet.cpp +++ b/src/tools/uchardet.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #ifndef VERSION #define VERSION "Unknown" @@ -135,7 +136,7 @@ int main(int argc, char ** argv) f = fopen(filename, "r"); if (f == NULL) { - fprintf(stderr, "Cannot open file '%s'\n", filename); + perror(filename); error_seen = 1; continue; }