• Robert Sprowson's avatar
    [582] Fix for abort when parsing font size near end of slot · b0520096
    Robert Sprowson authored
    When text is loaded into a diagram, and that text happens to be near the end
    of the Wimp slot, and there's no intervening 0 byte (Draw text areas use \n as
    terminators), then when getting the font size the call to strtod() could abort
    in a hidden library call to strlen() when it scans forwards looking for a
    terminator. Much of the time you'd get away with it if the previous use of
    that page happened to contain a 0 byte.
    
    Play it safe and copy the text to convert to a buffer before using the C
    library functions. The conversion buffer is set to be larger than the longest
    possible value, rather than clipping the text exactly, so that LONG_MAX and
    HUGE_VAL can be returned in the error case.
    
    Version 1.46. Tagged as 'Draw-1_46'
    b0520096