Re: [Openvpn-devel] [PATCH v2] rewrite parse_hash_fingerprint()

2021-04-27 Thread Antonio Quartulli
Hi, On 27/04/2021 13:03, Gert Doering wrote: > The existing code was doing far too much work for too little > gain - copying the string segment for scanf(), checking extra > for spaces, making the result quite unreadable. > > Verify each segment with (short-circuited) isxdigit() checks, > then fe

[Openvpn-devel] [PATCH v2] rewrite parse_hash_fingerprint()

2021-04-27 Thread Gert Doering
The existing code was doing far too much work for too little gain - copying the string segment for scanf(), checking extra for spaces, making the result quite unreadable. Verify each segment with (short-circuited) isxdigit() checks, then feed directly to scanf(), which will stop parsing on ':' or