X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/28c3595a77a8c942bee1057085776dad0b3d53f4..7a2ed982bc5ffc80747768c807828ba252bc8265:/uip/mkstemp.c diff --git a/uip/mkstemp.c b/uip/mkstemp.c index 16ddf644..8139fec7 100644 --- a/uip/mkstemp.c +++ b/uip/mkstemp.c @@ -48,7 +48,9 @@ main(int argc, char *argv[]) { if ((suffix_len = strlen(suffix)) > 0) { # if HAVE_MKSTEMPS if ((fd = mkstemps(template, suffix_len)) < 0) { perror("mkstemps"); } -# endif /* HAVE_MKSTEMPS */ +# else /* ! HAVE_MKSTEMPS */ + fd = 0; +# endif /* ! HAVE_MKSTEMPS */ } else { if ((fd = mkstemp(template)) < 0) { perror("mkstemp"); } } @@ -102,7 +104,7 @@ build_template(const char *directory, const char *prefix, const char *suffix) { tp += sizeof pattern - 1; (void) strncpy(tp, suffix, suffix_len); - tp += suffix_len; + /* tp += suffix_len; */ template[len-1] = '\0';