GNU bug report logs -
#9762
tac fails when given multiple non-seekable inputs due to misuse of mkstemp()
Previous Next
Full log
Message #20 received at 9762 <at> debbugs.gnu.org (full text, mbox):
Jim Meyering wrote:
...
>> maint: tac: remove sole use of sprintf in favor of stpcpy
> ...
>
> I realized that this part of the first patch wasn't quite right...
>
>> Subject: [PATCH 1/3] maint: tac: remove sole use of sprintf in favor of
>> stpcpy
...
>> /* FIXME: there's a small window between a successful mkstemp call
>
> Rather than hard-coding the "/", computing lengths, and using separate
> xmalloc and 3 stpcpy calls, I prefer to use file_name_concat:
>
>>From 54eab68b8c50f93484194090cdc1f079af5533b6 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering <at> redhat.com>
> Date: Sun, 16 Oct 2011 10:35:56 +0200
> Subject: [PATCH 1/3] maint: tac: remove sole use of sprintf in favor of
> filenamecat
>
> * src/tac.c: Include filenamecat.h.
> (copy_to_temp): Use filenamecat rather than xmalloc and sprintf.
> Move some declarations "down" to point of initialization.
> ---
> src/tac.c | 16 ++++++----------
> 1 files changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/src/tac.c b/src/tac.c
> index 65ac6a6..95a5df7 100644
> --- a/src/tac.c
> +++ b/src/tac.c
> @@ -49,6 +49,7 @@ tac -r -s '.\|
> #include "safe-read.h"
> #include "stdlib--.h"
> #include "xfreopen.h"
> +#include "filenamecat.h"
And I nearly left it that way.
Tweaked to insert the new include in alphabetical order
like all of the others, and pushed.
This bug report was last modified 13 years and 223 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.