From 1ae2e55141b10af641104558698ebbc54db03200 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 18 Feb 2015 06:24:31 -0700 Subject: [PATCH] Fix mkstemps() extension handling. Sudoedit will now preserve the extension properly when the system libc lacks mkstemps(). --- lib/util/mktemp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/mktemp.c b/lib/util/mktemp.c index 50ce6ccda..fa86d123e 100644 --- a/lib/util/mktemp.c +++ b/lib/util/mktemp.c @@ -140,7 +140,7 @@ mktemp_internal(char *path, int slen, int mode) tries *= 2; do { - for (cp = start; *cp; cp++) { + for (cp = start; cp != ep; cp++) { r = get_random() % NUM_CHARS; *cp = tempchars[r]; }