libnetutils: Turn on -Werror

- Get rid of a pair of out of range comparison warnings.
- Turn on -Werror for compilation

Change-Id: Ie6754f41f9348852a02cc0ff35befb5a76ac2883
This commit is contained in:
Mark Salyzyn 2014-05-15 15:08:50 -07:00
parent f5e2dc8967
commit c829080ba9
2 changed files with 11 additions and 7 deletions

View file

@ -1,7 +1,7 @@
LOCAL_PATH:= $(call my-dir)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
LOCAL_SRC_FILES := \
dhcpclient.c \
dhcpmsg.c \
dhcp_utils.c \
@ -12,6 +12,8 @@ LOCAL_SHARED_LIBRARIES := \
libcutils \
liblog
LOCAL_MODULE:= libnetutils
LOCAL_MODULE := libnetutils
LOCAL_CFLAGS := -Werror
include $(BUILD_SHARED_LIBRARY)

View file

@ -282,16 +282,18 @@ void dump_dhcp_msg(dhcp_msg *msg, int len)
ALOGD("chaddr = {%s}", buf);
for (n = 0; n < 64; n++) {
if ((msg->sname[n] < ' ') || (msg->sname[n] > 127)) {
if (msg->sname[n] == 0) break;
unsigned char x = msg->sname[n];
if ((x < ' ') || (x > 127)) {
if (x == 0) break;
msg->sname[n] = '.';
}
}
msg->sname[63] = 0;
for (n = 0; n < 128; n++) {
if ((msg->file[n] < ' ') || (msg->file[n] > 127)) {
if (msg->file[n] == 0) break;
unsigned char x = msg->file[n];
if ((x < ' ') || (x > 127)) {
if (x == 0) break;
msg->file[n] = '.';
}
}