[Bug 48323] New: scanf functions do not support NaN for floating point elements

WineHQ Bugzilla wine-bugs at winehq.org
Sat Dec 21 05:45:18 CST 2019


https://bugs.winehq.org/show_bug.cgi?id=48323

            Bug ID: 48323
           Summary: scanf functions do not support NaN for floating point
                    elements
           Product: Wine
           Version: 5.0-rc2
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: msvcrt
          Assignee: wine-bugs at winehq.org
          Reporter: codedonewell at gmail.com
      Distribution: ---

Created attachment 66042
  --> https://bugs.winehq.org/attachment.cgi?id=66042
Return zero when NaN is found while parsing floats

Star Citizen PTU Version 3.8.0 is attempting to read float values from data
files that contain the text "nan". The current scanf.h implementation does not
consider NaNs.  This prevents this version of Star Citizen from launching when
run under wine.  This version does launch under windows with the same account.
I have tested a patch that returns zero when a NaN is encountered, which allows
this version of Star Citizen to launch.
There are several considerations to be addressed in this patch:
1 - it is not locale friendly;
2 - it updates the parse pointer as it checks for the text NAN, whcih means a
failure will return an incorreclty update pointer; and
3 - it returns zero when NAN is encountered rather than NAN as returning NAN
still breaks this version of Star Citizen.
I am keen to work up a more appropriate patch, however I need guidance
regarding the decision to return zero (rather than NaN - zero works for me but
might be bad), and how to look-ahead when checking for "NaN" without updating
the parse pointer.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list