From ed4a3cdcf102820367117897af09c1d510d20765 Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Tue, 3 Nov 2015 16:19:47 +1100 Subject: [PATCH] compare: always use braces for for/if blocks --- src/util/compare.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/util/compare.h b/src/util/compare.h index b7237ec2..11c01f08 100644 --- a/src/util/compare.h +++ b/src/util/compare.h @@ -98,18 +98,22 @@ u64a theirtoupper64(const u64a x) { static really_inline int cmpNocaseNaive(const u8 *p1, const u8 *p2, size_t len) { const u8 *pEnd = (const u8 *)p1 + len; - for (; p1 < pEnd; p1++, p2++) - if (mytolower(*p1) != mytolower(*p2)) + for (; p1 < pEnd; p1++, p2++) { + if (mytolower(*p1) != mytolower(*p2)) { return 1; + } + } return 0; } static really_inline int cmpCaseNaive(const u8 *p1, const u8 *p2, size_t len) { const u8 *pEnd = (const u8 *)p1 + len; - for (; p1 < pEnd; p1++, p2++) - if (*p1 != *p2) + for (; p1 < pEnd; p1++, p2++) { + if (*p1 != *p2) { return 1; + } + } return 0; }