X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/f61f588783b68ff542e6735a90a8dcbe9ad8308e..471a8ddb278cb5621e36a6c45e450d40580e50fd:/projects/sgconf/parser.cpp diff --git a/projects/sgconf/parser.cpp b/projects/sgconf/parser.cpp index 8e1e3cf1..79833fd3 100644 --- a/projects/sgconf/parser.cpp +++ b/projects/sgconf/parser.cpp @@ -35,7 +35,8 @@ #include "stg/common.h" #include "stg/netunit.h" -#include "stg/request.h" + +#include "request.h" using namespace std; @@ -86,7 +87,6 @@ parse_depth--; int ParseReply(void * data, list * ans) { int done = 0; -int len; parse_depth = 0; parser = XML_ParserCreate(NULL); @@ -103,7 +103,7 @@ XML_SetElementHandler(parser, StartElement, EndElement); list::iterator n = ans->begin(); while (n != ans->end()) { - len = strlen(n->c_str()); + size_t len = strlen(n->c_str()); if (++n == ans->end()) done = 1; @@ -111,8 +111,7 @@ while (n != ans->end()) if (XML_Parse(parser, n->c_str(), len, done) == XML_STATUS_ERROR) { - char s[128]; - printf(s, "Parse error at line %d:\n%s\n", + printf("Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser))); exit(UNKNOWN_ERR_CODE);