Some local temp string as std::string.
This commit is contained in:
@ -28,6 +28,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#define LEN 1000
|
#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.
|
trie = NULL; // As long we are not sure whether a pattern file can be read.
|
||||||
|
|
||||||
int bufLen = strlen (patFile) + 5 + 1;
|
using namespace std::literals::string_literals;
|
||||||
char *buf = new char[bufLen];
|
FILE *trieF = fopen ( (patFile + ".trie"s).c_str(), "r");
|
||||||
snprintf(buf, bufLen, "%s.trie", patFile);
|
|
||||||
FILE *trieF = fopen (buf, "r");
|
|
||||||
delete[] buf;
|
|
||||||
|
|
||||||
if (trieF) {
|
if (trieF) {
|
||||||
trie = new Trie ();
|
trie = new Trie ();
|
||||||
|
|||||||
Reference in New Issue
Block a user