diff options
author | Robin Gareus <robin@gareus.org> | 2019-06-24 14:11:53 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-06-24 14:11:53 +0200 |
commit | 336d12274536eee5863f507f305da5e661948118 (patch) | |
tree | f51592d46a39cd5bcb925e8bff3e4eb3626c39d2 /ptformat/ptformat.h | |
parent | d98bba43f173aa5e06c39f32c167ec207be41879 (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/ptformat.h')
-rw-r--r-- | ptformat/ptformat.h | 2 |
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); |