[rtems-libbsd commit] Fix dhcpcd.conf content
Sebastian Huber
sebh at rtems.org
Thu Oct 11 05:27:13 UTC 2018
Module: rtems-libbsd
Branch: master
Commit: 4a5f546d8d236e0888ceaa46a53009fd96f0f430
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=4a5f546d8d236e0888ceaa46a53009fd96f0f430
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Oct 11 07:25:34 2018 +0200
Fix dhcpcd.conf content
Do not write '\0' characters to the file. This confuses the options
parser.
---
testsuite/include/rtems/bsd/test/default-network-init.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/testsuite/include/rtems/bsd/test/default-network-init.h b/testsuite/include/rtems/bsd/test/default-network-init.h
index 4cdfc23..27a5fa7 100644
--- a/testsuite/include/rtems/bsd/test/default-network-init.h
+++ b/testsuite/include/rtems/bsd/test/default-network-init.h
@@ -141,14 +141,14 @@ default_network_dhcpcd(void)
S_IRWXU | S_IRWXG | S_IRWXO);
assert(fd >= 0);
- n = write(fd, default_cfg, sizeof(default_cfg));
- assert(n == (ssize_t) sizeof(default_cfg));
+ n = write(fd, default_cfg, sizeof(default_cfg) - 1);
+ assert(n == (ssize_t) sizeof(default_cfg) - 1);
#ifdef DEFAULT_NETWORK_DHCPCD_NO_DHCP_DISCOVERY
static const char nodhcp_cfg[] = "nodhcp\nnodhcp6\n";
- n = write(fd, nodhcp_cfg, sizeof(nodhcp_cfg));
- assert(n == (ssize_t) sizeof(nodhcp_cfg));
+ n = write(fd, nodhcp_cfg, sizeof(nodhcp_cfg) - 1);
+ assert(n == (ssize_t) sizeof(nodhcp_cfg) - 1);
#endif
rv = close(fd);
More information about the vc
mailing list