regarding bug 756

Dimitrie O. Paun dpaun at rogers.com
Wed Aug 7 15:18:28 CDT 2002


> From: Daniel Gudbjartsson <dfg at decode.is>

>  static int char2digit(char c, int base) {
> -    if ((c>='0') && (c<='9') && (c<='0'+base-1)) return (c-'0');
> +    if ((c>='0') && (c<='9') && (c<='0')+base-1) return (c-'0');

First off, I can't parse the above. It's A && B && C + base -1. What is that?!?

If you intend to clean it up, make it more readable:
+    if (('0' <= c) && (c <= min('0'+base-1, '9')) return c-')';

'cause that's what you want to say: if c is a valid digit (but no more then '9') in the given base, right?

--
Dimi.




More information about the wine-devel mailing list