summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Kline2015-03-04 02:13:10 -0600
committerErik Kline2015-03-04 02:15:28 -0600
commit314d82c3c514f7f216e99e9b2ad760ed0f7354c8 (patch)
tree5a1172bbe70ba0c92e737ded649b85503b1dc75e /libnetutils
parentc2291a7ed34edeae230a57607a964209f6932357 (diff)
downloadplatform-system-core-314d82c3c514f7f216e99e9b2ad760ed0f7354c8.tar.gz
platform-system-core-314d82c3c514f7f216e99e9b2ad760ed0f7354c8.tar.xz
platform-system-core-314d82c3c514f7f216e99e9b2ad760ed0f7354c8.zip
Make sure errmsg starts out null-terminated.
Also: clean up some stray trailing whitespace. Change-Id: I12471b6059971c9c25d7ff6475bfad43cbee44f6
Diffstat (limited to 'libnetutils')
-rw-r--r--libnetutils/dhcp_utils.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libnetutils/dhcp_utils.c b/libnetutils/dhcp_utils.c
index 9b7bd8d0c..fb5212b51 100644
--- a/libnetutils/dhcp_utils.c
+++ b/libnetutils/dhcp_utils.c
@@ -1,16 +1,16 @@
1/* 1/*
2 * Copyright 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. 5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at 6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.0 8 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software 10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, 11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 16
@@ -33,7 +33,7 @@ static const char DHCP_CONFIG_PATH[] = "/system/etc/dhcpcd/dhcpcd.conf";
33static const int NAP_TIME = 200; /* wait for 200ms at a time */ 33static const int NAP_TIME = 200; /* wait for 200ms at a time */
34 /* when polling for property values */ 34 /* when polling for property values */
35static const char DAEMON_NAME_RENEW[] = "iprenew"; 35static const char DAEMON_NAME_RENEW[] = "iprenew";
36static char errmsg[100] = ""; 36static char errmsg[100] = "\0";
37/* interface length for dhcpcd daemon start (dhcpcd_<interface> as defined in init.rc file) 37/* interface length for dhcpcd daemon start (dhcpcd_<interface> as defined in init.rc file)
38 * or for filling up system properties dhcpcd.<interface>.ipaddress, dhcpcd.<interface>.dns1 38 * or for filling up system properties dhcpcd.<interface>.ipaddress, dhcpcd.<interface>.dns1
39 * and other properties on a successful bind 39 * and other properties on a successful bind
@@ -75,7 +75,7 @@ static int wait_for_property(const char *name, const char *desired_value, int ma
75 while (maxnaps-- > 0) { 75 while (maxnaps-- > 0) {
76 usleep(NAP_TIME * 1000); 76 usleep(NAP_TIME * 1000);
77 if (property_get(name, value, NULL)) { 77 if (property_get(name, value, NULL)) {
78 if (desired_value == NULL || 78 if (desired_value == NULL ||
79 strcmp(value, desired_value) == 0) { 79 strcmp(value, desired_value) == 0) {
80 return 0; 80 return 0;
81 } 81 }