summaryrefslogtreecommitdiff
path: root/ptformat
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-06-24 14:11:53 +0200
committerRobin Gareus <robin@gareus.org>2019-06-24 14:11:53 +0200
commit336d12274536eee5863f507f305da5e661948118 (patch)
treef51592d46a39cd5bcb925e8bff3e4eb3626c39d2 /ptformat
parentd98bba43f173aa5e06c39f32c167ec207be41879 (diff)
Directly allocate a std::string -- remove strndup()/free()
strndup() is a GNU-extension, not available to MSVC and default macOS/X builds. g_strndup() would have been an alternative. Directly constructing std::string() is however more efficient.
Diffstat (limited to 'ptformat')
-rw-r--r--ptformat/ptformat.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ptformat/ptformat.h b/ptformat/ptformat.h
index 6fb6ceb..3426d7e 100644
--- a/ptformat/ptformat.h
+++ b/ptformat/ptformat.h
@@ -253,7 +253,7 @@ private:
bool foundin(std::string const& haystack, std::string const& needle);
int64_t foundat(unsigned char *haystack, uint64_t n, const char *needle);
- char *parsestring(uint32_t pos);
+ std::string parsestring(uint32_t pos);
const std::string get_content_description(uint16_t ctype);
int parse(void);
void parseblocks(void);