diff options
-rw-r--r-- | src/sort.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sort.c b/src/sort.c index 45a769ef0..0b93c54be 100644 --- a/src/sort.c +++ b/src/sort.c @@ -303,10 +303,11 @@ tempname () struct tempnode *node = (struct tempnode *) xmalloc (sizeof (struct tempnode)); - if (len && temp_file_prefix[len - 1] != '/') - sprintf (name, "%s/sort%5.5d%5.5d", temp_file_prefix, getpid (), ++seq); - else - sprintf (name, "%ssort%5.5d%5.5d", temp_file_prefix, getpid (), ++seq); + sprintf (name, + (len && temp_file_prefix[len - 1] != '/' + ? "%s/sort%5.5d%5.5d" + : "%ssort%5.5d%5.5d"), + temp_file_prefix, (int) getpid (), ++seq); node->name = name; node->next = temphead.next; temphead.next = node; |