- int tmpResult = Int32.Parse (s, style, fp);
- if (tmpResult > Int16.MaxValue || tmpResult < Int16.MinValue)
- throw new OverflowException ("Value too large or too small.");
+ int tmpResult = Int32.Parse (s, style, provider);
+ if ((style & NumberStyles.AllowHexSpecifier) != 0) {
+ if (tmpResult >= 0 && tmpResult <= ushort.MaxValue)
+ return (short) tmpResult;
+ } else if (tmpResult <= MaxValue && tmpResult >= MinValue) {
+ return (short) tmpResult;
+ }