2015-01-07 12:12 GMT+03:00 Dongsheng Song <dongsheng.s...@gmail.com>:

> On Wed, Jan 7, 2015 at 4:50 PM, niXman <i.nix...@autistici.org> wrote:
> > Dongsheng Song 2015-01-07 11:34:
> >
> >> Since the last 6 characters must be "XXXXXX" is mandatory, I think no
> >> need such tricks.
> > You do not know what will change through the 1,5,10 years.
> >
>
> No, it should not changed, this is widely used API. Such changes will
> break lots of application.
> Maybe another function will defined, e.g. mkstemp2.
>
> >
> >> I think the merged condition statement is not very complicated.
> > But why is it deliberately complicated?
> >
>
> I don‘t thinks the following  code (V1):
>
>     if (template_name == NULL || (len = strlen (template_name)) < 6
>             || memcmp (template_name + (len - 6), "XXXXXX", 6)) {
>         errno = EINVAL;
>         return -1;
>     }
>
> bad than (V2):
>
>     if (template_name == NULL) {
>         errno = EINVAL;
>         return -1;
>     }
>
>     if ((len = strlen (template_name)) < 6
>             || memcmp (template_name + (len - 6), "XXXXXX", 6)) {
>         errno = EINVAL;
>         return -1;
>     }
>
>
Current "mkstemp" implementation call "_sopen_s" that is not present in
WinXP msvcrt.dll. So this break supporting WinXP.

Regards,
Alexey.

>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to