1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-07-02 21:09:29 +03:00

resolveip: fix endless getopt() loop when compiled for arm (#12290)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34116 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2012-11-08 10:48:08 +00:00
parent 42954b7559
commit 1f2b4a912d
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2011 OpenWrt.org # Copyright (C) 2011-2012 OpenWrt.org
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=resolveip PKG_NAME:=resolveip
PKG_RELEASE:=1 PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

View File

@ -35,7 +35,7 @@ static void show_usage(void)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int timeout = 3; int timeout = 3;
char opt; int opt;
char ipaddr[INET6_ADDRSTRLEN]; char ipaddr[INET6_ADDRSTRLEN];
void *addr; void *addr;
struct addrinfo *res, *rp; struct addrinfo *res, *rp;
@ -49,7 +49,7 @@ int main(int argc, char **argv)
while ((opt = getopt(argc, argv, "46t:h")) > -1) while ((opt = getopt(argc, argv, "46t:h")) > -1)
{ {
switch (opt) switch ((char)opt)
{ {
case '4': case '4':
hints.ai_family = AF_INET; hints.ai_family = AF_INET;