X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=common%2Futils.c;h=6dac3dc1177b9ec4baf075ee4dd426f22becca6f;hb=5dee314c9cfa99e9211d6ace429fe5a89a51dfe3;hp=bf3516ff90f06da9b951a29cfe43dd84c6afdaa7;hpb=4dffb2516761d9be6bf811b7fa6b06fae4208d8a;p=doldaconnect.git diff --git a/common/utils.c b/common/utils.c index bf3516f..6dac3dc 100644 --- a/common/utils.c +++ b/common/utils.c @@ -82,16 +82,16 @@ char *vsprintf2(char *format, va_list al) va_list al2; va_copy(al2, al); - ret = vsnprintf(NULL, 0, format, al); - va_end_(al2); + ret = vsnprintf(NULL, 0, format, al2); + va_end(al2); if((buf = malloc(ret + 1)) == NULL) { LOGOOM(ret + 1); return(NULL); } va_copy(al2, al); - vsnprintf(buf, ret + 1, format, al); - va_end_(al2); + vsnprintf(buf, ret + 1, format, al2); + va_end(al2); return(buf); } @@ -118,7 +118,7 @@ wchar_t *vswprintf2(wchar_t *format, va_list al) { va_copy(al2, al); ret = vswprintf(buf, bufsize, format, al2); - va_end_(al2); + va_end(al2); if(ret >= 0) break; buf = srealloc(buf, sizeof(wchar_t) * (bufsize *= 2)); @@ -441,11 +441,7 @@ int wcsexists(wchar_t *h, wchar_t *n) #ifndef HAVE_WCSCASECMP int wcscasecmp(const wchar_t *s1, const wchar_t *s2) { - while(towlower(*s1) == towlower(*s2)) - { - if(*s1 == L'\0') - return(0); - } + for(; (towlower(*s1) == towlower(*s2)) && (*s1 != L'\0'); s1++, s2++); return(towlower(*s1) - towlower(*s2)); } #endif