/*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
std::ostringstream message;
CfgFile *f = CfgFiles.top();
message << "Bungled " << f->filePath << " line " << f->lineNo <<
- ": " << f->currentLine << std::endl;
+ ": " << f->currentLine << std::endl;
CfgFiles.pop();
delete f;
while (!CfgFiles.empty()) {
f = CfgFiles.top();
message << " included from " << f->filePath << " line " <<
- f->lineNo << ": " << f->currentLine << std::endl;
+ f->lineNo << ": " << f->currentLine << std::endl;
CfgFiles.pop();
delete f;
}
message << " included from " << cfg_filename << " line " <<
- config_lineno << ": " << config_input_line << std::endl;
+ config_lineno << ": " << config_input_line << std::endl;
std::string msg = message.str();
fatalf("%s", msg.c_str());
} else
char *
ConfigParser::Undo()
{
- LOCAL_ARRAY(char, undoToken, CONFIG_LINE_LIMIT);
+ static char undoToken[CONFIG_LINE_LIMIT];
if (!Undo_.empty()) {
- strncpy(undoToken, Undo_.front().c_str(), sizeof(undoToken));
+ xstrncpy(undoToken, Undo_.front().c_str(), sizeof(undoToken));
undoToken[sizeof(undoToken) - 1] = '\0';
if (!PreviewMode_)
Undo_.pop();
static FILE *wordFile = NULL;
char *t;
- LOCAL_ARRAY(char, buf, CONFIG_LINE_LIMIT);
+ static char buf[CONFIG_LINE_LIMIT];
if ((t = ConfigParser::Undo()))
return t;
}
/* fromFile */
- if (fgets(buf, CONFIG_LINE_LIMIT, wordFile) == NULL) {
+ if (fgets(buf, sizeof(buf), wordFile) == NULL) {
/* stop reading from file */
fclose(wordFile);
wordFile = NULL;
if (errorStr) {
if (PreviewMode_)
- strncpy(UnQuoted, SQUID_ERROR_TOKEN, sizeof(UnQuoted));
+ xstrncpy(UnQuoted, SQUID_ERROR_TOKEN, sizeof(UnQuoted));
else {
debugs(3, DBG_CRITICAL, "FATAL: " << errorStr << ": " << errorPos);
self_destruct();
while (ConfigParser::RecognizeQuotedPair_ && *nextToken == '\\') {
// NP: do not permit \0 terminator to be escaped.
if (*(nextToken+1) && *(nextToken+1) != '\r' && *(nextToken+1) != '\n') {
- nextToken += 2; // skip the quoted-pair (\-escaped) character
- nextToken += strcspn(nextToken, sep);
+ nextToken += 2; // skip the quoted-pair (\-escaped) character
+ nextToken += strcspn(nextToken, sep);
} else {
debugs(3, DBG_CRITICAL, "FATAL: Unescaped '\' character in regex pattern: " << tokenStart);
self_destruct();
if (wordFile)
fclose(wordFile);
}
+