--- frontend/file-selector.cc +++ frontend/file-selector.cc @@ -853,7 +853,9 @@ // check write access to the directory (note that we need execute // privileges as well) - char *slash = strrchr( file, '/'); + char *slash; + strcpy (slash, strrchr( file, '/')); + *slash = '\0'; // temporarily truncate to dirname const char *dir = (file == slash ? "/" // whoops!, file in root directory @@ -988,7 +990,8 @@ { bool found = false; - char *slash = strrchr( regexp, '/' ); + char *slash; + strcpy(slash, strrchr( regexp, '/' )); if (!slash) return true; --- lib/fax-encoder.cc +++ lib/fax-encoder.cc @@ -34,6 +34,7 @@ #include "fax-encoder.hh" #include +#include #define WHITE false #define BLACK true