From 9d3bf0f1641bd73e7203b4e95e4de212ee874ed5 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 24 Sep 2014 21:24:52 +0200 Subject: [PATCH] Update wcsspn(3) to current coding conventions. --- libc/wchar/wcsspn.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libc/wchar/wcsspn.cpp b/libc/wchar/wcsspn.cpp index 0d1a6143..b466a93c 100644 --- a/libc/wchar/wcsspn.cpp +++ b/libc/wchar/wcsspn.cpp @@ -26,19 +26,23 @@ extern "C" size_t wcsspn(const wchar_t* str, const wchar_t* accept) { - size_t acceptlen = 0; - while ( accept[acceptlen] ) { acceptlen++; } + size_t accept_length = 0; + while ( accept[accept_length] ) + accept_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 < acceptlen; i++ ) + for ( size_t i = 0; i < accept_length; i++ ) { - if ( str[result] != accept[i] ) { continue; } + if ( str[result] != accept[i] ) + continue; matches = true; break; } - if ( !matches ) { return result; } + if ( !matches ) + return result; } }