> - Greg's tweak to handle file:// prefixes also segfaults. Alvin's  
> version works. The difference seems to be that, when passed the string:
>       file:///path/to/image.jpg
> Greg strips the "file:" off so it becomes
>       ///path/to/image.jpg
> which seems to cause OSX some problems.

        Hmm, all unices I've seen treat extra slashes as a single slash,
        so I'm not sure that'd be a problem.

        Also, seems odd is that extra slashes would be any kind of cause
        of a segfault.

        When you ran your test with my tweaks, did you fix the 
multibyte_convert()
        problem first? That might be the cause of the segfault. Or maybe I have
        a bug somewhere else.. for instance wasn't sure if my use of strcpy()
        within a string was valid.. memmove() might be safer, as it explicitly
        allows memory areas to overlap.

        I guess I'll check for this on the mac to see what's up.
        I only tested on linux.

        Certainly sounds like the DND payload needs to be very carefully
        checked for sanity, but since it's an example, we can probably
        leave sanity checking as an exercise to the reader.

        One thing the article should probably link to is the specs for
        DND payloads, if there is such a thing. I assume there must be
        some standard, so that if an app sends raw binary data as a payload,
        there's some way apps that expect strings won't crash while parsing it.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to