From: Peter Krefting Date: Mon, 01 Jul 2013 07:12:40 GMT Subject: Re: [PATCH 1/2] commit: reject invalid UTF-8 codepoints Message-ID: In-Reply-To: <20130629174023.GB226907@vauxhall.crustytoothpaste.net> brian m. carlson: > + /* Check the value here */ > + if (codepoint >= 0xd800 && codepoint <= 0xdfff) > + return bad_offset; if ((x & 0xFFFFF800) == 0xD800) is slightly shorter, albeit a bit more difficult to read. Please also consider adding some commentary as to what you are checking here, as it is not obvious unless you know Unicode well. -- \\// Peter - http://www.softwolves.pp.se/