From ece0ca2799f86a80ae68972d3c45c9367bc843a0 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Tue, 12 Mar 2013 12:59:43 +0100 Subject: [PATCH] Fix previous commit --- coreapi/upnp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/coreapi/upnp.c b/coreapi/upnp.c index e8841c2d..2dfd7f39 100644 --- a/coreapi/upnp.c +++ b/coreapi/upnp.c @@ -114,19 +114,17 @@ int linphone_upnp_context_send_add_port_binding(UpnpContext *lupnp, UpnpPortBind static int linphone_upnp_strncmpi(const char *str1, const char *str2, int len) { int i = 0; char char1, char2; - while(true) { - if(i >= len) { - return 0; - } + while(i < len) { char1 = toupper(*str1); char2 = toupper(*str2); - if(char1 == '\0' || char2 == '\0' || char1 != char2) { + if(char1 == '\0' || char1 != char2) { return char1 - char2; } str1++; str2++; i++; } + return 0; } static int linphone_upnp_str_min(const char *str1, const char *str2) { -- 2.39.2