Cursor shenanigans

I can’t seem to get the SDL_CreateCursor code working correctly.

I tried the sample code listed at:
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fCreateCursor
And this resulted in the messed up cursor pictured in this shot:

I then found some other code to make an SDL cursor, and this result
looked a lot better, but it was still messed up a bit.

Here is the code for it:
http://www.lackeyccg.com/CursorCodeSnippet.txt

And here is the resulting slightly messed up cursor:

Is there a bug in the SDL cursor code, or am I doing something
incorrectly? Does anyone have a link to some code that actually
demonstrates it correctly?

Thanks in advance.

-Trevor
www.lackeyccg.com