From b4c7a6aa4ac809a685f18adab09760ef112d1ebe Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 24 Sep 2014 21:19:10 +0200 Subject: [PATCH] Update wcscspn(3) to current coding conventions. --- libc/wchar/wcscspn.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libc/wchar/wcscspn.cpp b/libc/wchar/wcscspn.cpp index 0dd33c99..9d7eb29d 100644 --- a/libc/wchar/wcscspn.cpp +++ b/libc/wchar/wcscspn.cpp @@ -26,19 +26,23 @@ extern "C" size_t wcscspn(const wchar_t* str, const wchar_t* reject) { - size_t rejectlen = 0; - while ( reject[rejectlen] ) { rejectlen++; } + size_t reject_length = 0; + while ( reject[reject_length] ) + reject_length++; for ( size_t result = 0; true; result++ ) { wchar_t c = str[result]; - if ( !c ) { return result; } + if ( !c ) + return result; bool matches = false; - for ( size_t i = 0; i < rejectlen; i++ ) + for ( size_t i = 0; i < reject_length; i++ ) { - if ( str[result] != reject[i] ) { continue; } + if ( str[result] != reject[i] ) + continue; matches = true; break; } - if ( matches ) { return result; } + if ( matches ) + return result; } }