<[email protected]> writes:

> @@ -975,18 +975,31 @@ static  WORD            MCI_GetMessage(LPCWSTR lpCmd)
>   */
>  static       BOOL            MCI_GetDWord(DWORD* data, LPWSTR* ptr)
>  {
> -    DWORD    val;
> -    LPWSTR   ret;
> +    DWORD    val, total = 0;
> +    LPWSTR   ret, src = *ptr;
> +    int              shift = 0;
>  
> -    val = strtoulW(*ptr, &ret, 10);
> +  colonized:
> +    val = strtoulW(src, &ret, 10);
> +    if (ret == src)  return FALSE;
>  
>      switch (*ret) {
>      case '\0':       break;
> +    case '\t':
>      case ' ':        ret++; break;
> +    case ':': {
> +     if ((val >= 256) || (shift >= 24))      return FALSE;
> +     total |= val << shift;
> +     shift += 8;
> +     src = ret + 1;
> +     goto colonized;
> +     }

Please use a proper loop, not a goto.

-- 
Alexandre Julliard
[email protected]


Reply via email to