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; } ------------------------------------------------------------------------------ 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