Re: [Grubby - PATCH 3/4] Avoid string duplication calling dirname()

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

 



On 06/11/2012 12:29 PM, Adrian Perez wrote:
The dirname() function does not modify its argument, so it is uneeded to
duplicate the string passed to it.
---
  grubby.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grubby.c b/grubby.c
index 2dea8ee..4866f1d 100644
--- a/grubby.c
+++ b/grubby.c
@@ -1411,7 +1411,7 @@ static int writeConfig(struct grubConfig * cfg, char * outName,

  	    /* most likely the symlink is relative, so change our
  	       directory to the dir of the symlink */
-            rc = chdir(dirname(strdupa(outName)));
+            rc = chdir(dirname(outName));
  	    do {
  		buf = alloca(len + 1);
  		rc = readlink(basename(outName), buf, len);


Applied.

--
        Peter

Computers don't make errors.  What they do, they do on purpose.
		-- Dale

01234567890123456789012345678901234567890123456789012345678901234567890123456789


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux