bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCHv2 0/7] Re: temp file suffixes: mktemp DWIM


From: Eric Blake
Subject: Re: [PATCHv2 0/7] Re: temp file suffixes: mktemp DWIM
Date: Thu, 5 Nov 2009 15:19:10 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Blake <ebb9 <at> byu.net> writes:

> Aargh.  I just noticed that what I pushed still has a bug:
> 
> $ src/mktemp -u XXXXXXXXXXXXXXXXX.pdf
> XXXXXXXXXXXXXpiYD.pdf
> 
> Rather than replacing all the X, it is only replacing the number of X in
> the suffix.  And the testsuite didn't catch it :(

But --enable-gcc-warnings did.

| cc1: warnings being treated as errors
| mktemp.c: In function ‘mkstemp_len’:
| mktemp.c:118: error: unused parameter ‘x_len’ [-Wunused-parameter]
| mktemp.c: In function ‘mkdtemp_len’:
| mktemp.c:125: error: unused parameter ‘x_len’ [-Wunused-parameter]

Here's what I'll push that once I get a chance to turn this into a proper patch.


diff --git i/src/mktemp.c w/src/mktemp.c
index ac35026..f60e824 100644
--- i/src/mktemp.c
+++ w/src/mktemp.c
@@ -118,14 +118,14 @@ static int
 mkstemp_len (char *tmpl, size_t suff_len, size_t x_len, bool dry_run)
 {
   return gen_tempname_len (tmpl, suff_len, 0, dry_run ? GT_NOCREATE : GT_FILE,
-                           suff_len);
+                           x_len);
 }

 static int
 mkdtemp_len (char *tmpl, size_t suff_len, size_t x_len, bool dry_run)
 {
   return gen_tempname_len (tmpl, suff_len, 0, dry_run ? GT_NOCREATE : GT_DIR,
-                           suff_len);
+                           x_len);
 }

 int






reply via email to

[Prev in Thread] Current Thread [Next in Thread]