diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-09 09:40:49 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-10 07:03:25 -0800 |
commit | 77da20196f3efe8eaf4a7bd898f0c6206d146c61 (patch) | |
tree | a31532d8d1e3410fd23b5af1d3b29c1b612d07bf /save-xml.c | |
parent | 22f66501ac4075084c0fd1d0b0d943aa92df1306 (diff) | |
download | subsurface-77da20196f3efe8eaf4a7bd898f0c6206d146c61.tar.gz |
Clean up membuffer internal structure names, add strip function
The "size" member was confusing - it's the size of the allocation, not
the size of the current string. The size of the current string is the
member called "used".
This naming makes perfect sense for the internal implementation, but
it's confusing to users who actually do want to get the size of the
resulting string at the end.
So rename the fields to "alloc" and "len" - which is pretty clear.
This also adds a helper function to strip whitespace from the end:
"strip_mb()".
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-xml.c')
-rw-r--r-- | save-xml.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/save-xml.c b/save-xml.c index 7eba7165c..7bb2642bd 100644 --- a/save-xml.c +++ b/save-xml.c @@ -610,7 +610,7 @@ void export_dives_uddf(const char *filename, const bool selected) * transform it to UDDF format, finally dumping * the XML into a character buffer. */ - doc = xmlReadMemory(buf.buffer, buf.used, "divelog", NULL, 0); + doc = xmlReadMemory(buf.buffer, buf.len, "divelog", NULL, 0); free_buffer(&buf); if (!doc) { fprintf(stderr, "Failed to read XML memory\n"); |