diff options
author | Jim Meyering <jim@meyering.net> | 1994-11-16 13:16:53 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1994-11-16 13:16:53 +0000 |
commit | 67af2936fab0429eb3aa1c3fc4fefd60c1752838 (patch) | |
tree | 0a52a6178b8a34d9dbc326640055731c3810c9f3 | |
parent | 5d9de33889dc5d5f9eb23025b122dc4dfa43ab81 (diff) | |
download | coreutils-67af2936fab0429eb3aa1c3fc4fefd60c1752838.tar.xz |
(tempname): Merge two very similar sprintf stmts into one.
-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; |