@@ -63,10 +63,11 @@ struct document
64typedef struct
64typedef struct
66− const document* d;
66+ const document* d; // Document, used to get at the body
67− char* buffer;
67+ char* buffer; // Buffer we are writing too
68− int length;
68+ int length; // Length of buffer, do not write past the end.
69− int cursor;
69+ // No character is reserved for a NULL terminator.
70+ int cursor; // Cursor of where we are writing now
72static inline void render_char(render* r, char c)
73static inline void render_char(render* r, char c)
@@ -178,7 +179,6 @@ attr* hexml_node_attributes(const document* d, const node* n, int* res)
178 return &d->attrs.attrs[n->attrs.start];
179 return &d->attrs.attrs[n->attrs.start];
182attr* hexml_node_attribute(const document* d, const node* n, const char* s, int slen)
182attr* hexml_node_attribute(const document* d, const node* n, const char* s, int slen)
184 if (slen == -1) slen = (int) strlen(s);
184 if (slen == -1) slen = (int) strlen(s);