[physfs] Replace malloc/strcpy by strdup

Tim Cas darkuranium at gmail.com
Wed Sep 29 11:25:30 EDT 2010


Correct me if I'm wrong, but strdup doesn't seem to be a part of the C90 or
C99 standard, but rather POSIX (which is a problem in Windows).

Compare:
http://www.opengroup.org/onlinepubs/009695399/basedefs/string.h.html (POSIX
implementation)
http://www.cplusplus.com/reference/clibrary/cstring/ (C99 and/or C++
implementation)

On 29 September 2010 15:27, Tolga Dalman <tolga.dalman at googlemail.com>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> the attached patch replaces a malloc and strdup sequence by a plain
> strdup. Also, I fixed a trivial copy & paste error in the error
> checking path.
>
> Thanks
> Tolga Dalman
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.16 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJMoz7JAAoJEI0vwg8AaIlUdQ8IAMBt9g3dBTJ2kL6ZkuoH3mKj
> +aYHwM7QVQHQmsgX9iYDoHkoVd+gCTqpweDlx03Jhtg90fmOf1tlmiOuZG4wRqqS
> 8PuTXf6MH+CMM/mjZuZRRUdBU7GTjR5FjNORLUrXCrFz/nMhG3NukgTyYiATv+22
> Ida3RQuB6lba0eKXwwTejq+NiWqu8+wX3xI906vhq5jV4TTBC2W8CrEyI6MlzLRp
> nvc2tsP6hM7m81hoPbyKfmBh6OMpFovPrVAf66AuiN2d1ZKdJviH2p+HSI1mq3F2
> ydaOm8guBgR42+MissNeBPb+7OvNlQHXZjyTpELpYDBq20wcXzbc3POy/nXBGXE=
> =gw62
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> physfs mailing list
> physfs at icculus.org
> http://icculus.org/mailman/listinfo/physfs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/physfs/attachments/20100929/7de5fd9e/attachment.htm>


More information about the physfs mailing list