From 343c23cc6c0868a22c2d5c77247c6d87dff8011a Mon Sep 17 00:00:00 2001 From: SCMcLaughlin Date: Thu, 15 Dec 2016 20:58:53 -0800 Subject: [PATCH] Additional LS config parser fixes: * use auto * fix some questionable uses of string.append() that were broken by the use of int/auto --- loginserver/config.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loginserver/config.cpp b/loginserver/config.cpp index ecffb00f7..5582e9754 100644 --- a/loginserver/config.cpp +++ b/loginserver/config.cpp @@ -144,7 +144,7 @@ void Config::Parse(const char *file_name) */ void Config::Tokenize(FILE *input, std::list &tokens) { - int c = fgetc(input); + auto c = fgetc(input); std::string lexeme; while(c != EOF) @@ -162,7 +162,7 @@ void Config::Tokenize(FILE *input, std::list &tokens) if(isalnum(c)) { - lexeme.append((const char *)&c, 1); + lexeme += c; c = fgetc(input); continue; } @@ -193,14 +193,14 @@ void Config::Tokenize(FILE *input, std::list &tokens) lexeme.clear(); } - lexeme.append((const char *)&c, 1); + lexeme += c; tokens.push_back(lexeme); lexeme.clear(); break; } default: { - lexeme.append((const char *)&c, 1); + lexeme += c; } }