If MHOctetString::MHOctetString allocates the string it
From: Erik Hovland <erik@hovland.org>
will be one char too short because strlen returns the length
of the given string w/o the null terminator.
---
libs/libmythfreemheg/BaseClasses.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libs/libmythfreemheg/BaseClasses.cpp b/libs/libmythfreemheg/BaseClasses.cpp
index ddcb43b..84b96e2 100644
a
|
b
|
MHOctetString::MHOctetString() |
40 | 40 | // Construct from a string |
41 | 41 | MHOctetString::MHOctetString(const char *str, int nLen) |
42 | 42 | { |
43 | | if (nLen < 0) nLen = strlen(str); |
| 43 | if (nLen < 0) nLen = strlen(str) + 1; |
44 | 44 | m_nLength = nLen; |
45 | 45 | if (nLen == 0) m_pChars = 0; |
46 | 46 | else { |