diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/amount.cc | 2 | ||||
-rw-r--r-- | src/xml.cc | 12 | ||||
-rw-r--r-- | src/xml.h | 13 |
3 files changed, 13 insertions, 14 deletions
diff --git a/src/amount.cc b/src/amount.cc index 85ba07f5..274d3001 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -283,7 +283,7 @@ namespace { } if (sign) { - char * newbuf = new char[std::strlen(result ? result : buf) + 1]; + char * newbuf = new char[std::strlen(result ? result : buf) + 2]; newbuf[0] = '-'; std::strcpy(&newbuf[1], result ? result : buf); mpz_set_str(dest, newbuf, 10); @@ -51,11 +51,6 @@ const char * document_t::ledger_builtins[] = { "transaction" }; -document_t::document_t(node_t * _top) - : stub(this), top(_top ? _top : &stub) { - TRACE_CTOR(xml::document_t, "node_t *, const char **, const int"); -} - document_t::~document_t() { TRACE_DTOR(xml::document_t); @@ -159,10 +154,9 @@ void document_t::print(std::ostream& out) const document_t * node_t::document; #endif -node_t::node_t(document_t * _document, parent_node_t * _parent, - flags_t _flags) - : supports_flags<>(_flags), - name_id(0), parent(_parent), next(NULL), prev(NULL), attrs(NULL) +node_t::node_t(document_t * _document, parent_node_t * _parent, flags_t _flags) + : supports_flags<>(_flags), name_id(0), parent(_parent), + next(NULL), prev(NULL), attrs(NULL) { TRACE_CTOR(node_t, "document_t *, node_t *"); document = _document; @@ -236,18 +236,23 @@ private: names_map names_index; - terminal_node_t stub; - - public: +public: node_t * top; +private: + terminal_node_t stub; + +public: // Ids 0-9 are reserved. 10-999 are for "builtin" names. 1000+ are // for dynamically registered names. enum special_names_t { CURRENT, PARENT, ROOT, ALL }; - document_t(node_t * _top = NULL); + document_t(node_t * _top = NULL) + : top(_top ? _top : &stub), stub(this) { + TRACE_CTOR(xml::document_t, "node_t *, const char **, const int"); + } ~document_t(); void set_top(node_t * _top); |