[MPlayer-dev-eng] [PATCH] MacOS X Application Bundle Support

Nicolas Plourde nicolas.plourde at sympatico.ca
Wed Dec 22 13:37:50 CET 2004


Reimar Döffinger wrote:

>Hi,
>  
>
>>>>does CFURLGetFileSystemRepresentation when it succeeds always 
>>>>guarantee to return a
>>>>null-terminated string (because e.g. snprintf (IMHO very stupidly) 
>>>>doesn't)?
>>>>If not you should make sure it the string always is null-terminated...
>>>>        
>>>>
>>>Yes. The documentation says:
>>>"Boolean CFURLGetFileSystemRepresentation (
>>>  CFURLRef url,
>>>  Boolean resolveAgainstBase,
>>>  UInt8 *buffer,
>>>  CFIndex maxBufLen
>>>);
>>>
>>>No more than maxBufLen bytes are written to buffer. If url requires 
>>>more than maxBufLen bytes to represent itself, including the 
>>>terminating null byte, this function returns false. To avoid this 
>>>possible failure, you should pass a buffer with size of at least the 
>>>maximum path length for the file system in question."
>>>
>>>So the loop will only exit when the full path (including the null 
>>>byte) will fit.
>>>      
>>>
>>Can this be applied?
>>    
>>
>
>Forgot to say: it's okay with me, I'm quite sure it won't break any
>existing code. But it won't compile with gcc 2.95 because that struct
>stat dummy isn't at the beginning of a block. Don't know if that is a
>requirement on OSX, but if yes add an extra { } pair in the #ifdef.
>  
>
it is on older osx release. I will fix it.

-- 
====
Nicolas Plourde <nicolas.plourde at sympatico.ca>





More information about the MPlayer-dev-eng mailing list