diff --git a/dw/hyphenator.cc b/dw/hyphenator.cc index 27b238b..06d892d 100644 --- a/dw/hyphenator.cc +++ b/dw/hyphenator.cc @@ -28,6 +28,8 @@ #include #include +#include + #define LEN 1000 /* @@ -50,11 +52,8 @@ Hyphenator::Hyphenator (const char *patFile, const char *excFile, int pack) { trie = NULL; // As long we are not sure whether a pattern file can be read. - int bufLen = strlen (patFile) + 5 + 1; - char *buf = new char[bufLen]; - snprintf(buf, bufLen, "%s.trie", patFile); - FILE *trieF = fopen (buf, "r"); - delete[] buf; + using namespace std::literals::string_literals; + FILE *trieF = fopen ( (patFile + ".trie"s).c_str(), "r"); if (trieF) { trie = new Trie ();