We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2311 - SDL_GetPrefPath broken, truncates path on Mac OS X.
Summary: SDL_GetPrefPath broken, truncates path on Mac OS X.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: file (show other bugs)
Version: 2.0.1
Hardware: All Mac OS X (All)
: P1 blocker
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-17 10:45 UTC by Brad Smith
Modified: 2014-03-02 01:30 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brad Smith 2013-12-17 10:45:21 UTC
SDL_sysfilesystem.m at line 72 note that the calculated value "len" does not include room for the "org" string. The resulting path is truncated by the number of characters in the org string.
Comment 1 Sam Lantinga 2014-02-13 05:17:28 UTC
Ryan, can you look at this for the 2.0.2 release?

Thanks!
Comment 2 Michael Labbé 2014-02-28 01:06:20 UTC
I stumbled on this bug and fixed it locally.  Here is the fixed line:

            const size_t len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4;
Comment 3 Sam Lantinga 2014-03-01 18:29:08 UTC
Ryan, it looks like you fixed this in this changeset:
https://hg.libsdl.org/SDL/rev/b34f5e226458
Comment 4 Ryan C. Gordon 2014-03-02 01:30:15 UTC
(In reply to Sam Lantinga from comment #3)
> Ryan, it looks like you fixed this in this changeset:
> https://hg.libsdl.org/SDL/rev/b34f5e226458

So I did!   :)

--ryan.