summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2017-12-07 19:36:15 +0100
committerKrzysztof Opasiak <k.opasiak@samsung.com>2017-12-11 22:40:26 +0100
commitad44340734fa3bb97c4472c6b004fa4ebdab335b (patch)
tree5345b860721c6edae613da7fb01dfc9e234c280a
parent4c6124d68f5d342fae79360a8f9996b88ac78ddb (diff)
downloadlibusbg-ad44340734fa3bb97c4472c6b004fa4ebdab335b.tar.gz
libusbg-ad44340734fa3bb97c4472c6b004fa4ebdab335b.tar.bz2
libusbg-ad44340734fa3bb97c4472c6b004fa4ebdab335b.zip
libusbgx: Do not write null terminator when using usbg_write_string()
The helper usbg_write_string() adds one to the length of the provided string. This leads to usbg_write_buf() writting also a null terminator to the kernel which is not necessary/wrong. Provide usbg_write_buf the real string length. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> [Add missing () to function names in commit msg] Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
-rw-r--r--src/usbg_common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/usbg_common.c b/src/usbg_common.c
index bd03498..b405a3d 100644
--- a/src/usbg_common.c
+++ b/src/usbg_common.c
@@ -204,7 +204,7 @@ int usbg_write_string(const char *path, const char *name,
{
int ret;
- ret = usbg_write_buf(path, name, file, buf, strlen(buf) + 1);
+ ret = usbg_write_buf(path, name, file, buf, strlen(buf));
if (ret > 0)
ret = 0;