Menu

#4 WriteTextWrapped-string end CRLF garbage

closed-fixed
5
2006-11-26
2002-06-24
No

Have run into a minor glitch however when displaying
with the WriteTextWrapped function... the issue is
specifically with a string that ends with a CRLF
(#13#10). Apparently the logic ends up parsing into
"unknownterritory" and displaying odd characters at end
of text area (random
garbage with whatever might be after the actual string
memory).

My simple work around has been to append a space
character to end of string before calling the
WriteTextWrapped function, and that circumvents the
issue. The problem itself has to do with how the
ReadWord function only handles checking for CR (#13) or
a space (' '), but doesn't handle an End Of Line (EOL
#13#10). I checked the code, and that definately is
the issue... Also, keep in mind that on Linux an EOL is
just #10 and not #13#10.

The fix may be to check for #10 in addition to just a
#13 and ' ' in the ReadWord function when checking for
end of word? (I have not had a chance to get back to
this issue - my work around solved the problem for me,
but a more permanent solution in the SDLMonoFonts code
would be best...)

Discussion

  • Dominique Louis

    Dominique Louis - 2003-02-14
    • assigned_to: nobody --> savage
     
  • Michalis Kamburelis

    Logged In: YES
    user_id=987895

    I was not able to reproduce this bug with CRLF line endings.
    It seems that as long as the line endings are Windows-style
    (CRLF, #13#10), everything should always be OK. What are the
    exact parameters to WriteTextWrapped to reproduce this bug ?

    I guess that you can set this request to pending now and
    have it closed if noone will be able to reproduce this bug
    anymore.

    As for UNIX line endings (#10) or Mac line endings (#13),
    this is indeed a bug, SDLMonoFonts indeed is not able to
    handle them. I just send a patch to JEDI-SDL mailing list to
    fix this, see thread "SDLMonoFonts fixes" on JEDI-SDL
    mailing list around 2006-01-08.

     
  • Dominique Louis

    Dominique Louis - 2006-11-26

    Logged In: YES
    user_id=12677
    Originator: NO

    Kambi's patch has been applied to this and it is checked into CVS.

     
  • Dominique Louis

    Dominique Louis - 2006-11-26
    • status: open --> closed-fixed
     

Log in to post a comment.