summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2014-05-15 17:08:50 -0500
committerMark Salyzyn2014-05-23 09:49:29 -0500
commitc829080ba9ef35237764cfb0d322e564a08ba842 (patch)
tree3572da9b9463876faa6828108e10de817c6ed2d6 /libnetutils
parentf5e2dc8967d66362a1d57ce6f764e4585aad9883 (diff)
downloadplatform-system-core-c829080ba9ef35237764cfb0d322e564a08ba842.tar.gz
platform-system-core-c829080ba9ef35237764cfb0d322e564a08ba842.tar.xz
platform-system-core-c829080ba9ef35237764cfb0d322e564a08ba842.zip
libnetutils: Turn on -Werror
- Get rid of a pair of out of range comparison warnings. - Turn on -Werror for compilation Change-Id: Ie6754f41f9348852a02cc0ff35befb5a76ac2883
Diffstat (limited to 'libnetutils')
-rw-r--r--libnetutils/Android.mk8
-rw-r--r--libnetutils/dhcpclient.c10
2 files changed, 11 insertions, 7 deletions
diff --git a/libnetutils/Android.mk b/libnetutils/Android.mk
index aba462184..1f61511e9 100644
--- a/libnetutils/Android.mk
+++ b/libnetutils/Android.mk
@@ -1,7 +1,7 @@
1LOCAL_PATH:= $(call my-dir) 1LOCAL_PATH := $(call my-dir)
2include $(CLEAR_VARS) 2include $(CLEAR_VARS)
3 3
4LOCAL_SRC_FILES:= \ 4LOCAL_SRC_FILES := \
5 dhcpclient.c \ 5 dhcpclient.c \
6 dhcpmsg.c \ 6 dhcpmsg.c \
7 dhcp_utils.c \ 7 dhcp_utils.c \
@@ -12,6 +12,8 @@ LOCAL_SHARED_LIBRARIES := \
12 libcutils \ 12 libcutils \
13 liblog 13 liblog
14 14
15LOCAL_MODULE:= libnetutils 15LOCAL_MODULE := libnetutils
16
17LOCAL_CFLAGS := -Werror
16 18
17include $(BUILD_SHARED_LIBRARY) 19include $(BUILD_SHARED_LIBRARY)
diff --git a/libnetutils/dhcpclient.c b/libnetutils/dhcpclient.c
index 34500e78c..b58120ec8 100644
--- a/libnetutils/dhcpclient.c
+++ b/libnetutils/dhcpclient.c
@@ -282,16 +282,18 @@ void dump_dhcp_msg(dhcp_msg *msg, int len)
282 ALOGD("chaddr = {%s}", buf); 282 ALOGD("chaddr = {%s}", buf);
283 283
284 for (n = 0; n < 64; n++) { 284 for (n = 0; n < 64; n++) {
285 if ((msg->sname[n] < ' ') || (msg->sname[n] > 127)) { 285 unsigned char x = msg->sname[n];
286 if (msg->sname[n] == 0) break; 286 if ((x < ' ') || (x > 127)) {
287 if (x == 0) break;
287 msg->sname[n] = '.'; 288 msg->sname[n] = '.';
288 } 289 }
289 } 290 }
290 msg->sname[63] = 0; 291 msg->sname[63] = 0;
291 292
292 for (n = 0; n < 128; n++) { 293 for (n = 0; n < 128; n++) {
293 if ((msg->file[n] < ' ') || (msg->file[n] > 127)) { 294 unsigned char x = msg->file[n];
294 if (msg->file[n] == 0) break; 295 if ((x < ' ') || (x > 127)) {
296 if (x == 0) break;
295 msg->file[n] = '.'; 297 msg->file[n] = '.';
296 } 298 }
297 } 299 }