[syslinux:pathbased] setadv: asprintf() doesn't return an error code

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Wed Jun 9 18:42:03 PDT 2010


Commit-ID:  d9408bb55f2c833de361cef1153c615d2874e7c6
Gitweb:     http://syslinux.zytor.com/commit/d9408bb55f2c833de361cef1153c615d2874e7c6
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Wed, 9 Jun 2010 18:28:34 -0700
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Wed, 9 Jun 2010 18:28:34 -0700

setadv: asprintf() doesn't return an error code

asprintf() doesn't return an error number, but a count of characters
(which we don't need.)

Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>


---
 libinstaller/setadv.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libinstaller/setadv.c b/libinstaller/setadv.c
index 682b883..c891b87 100644
--- a/libinstaller/setadv.c
+++ b/libinstaller/setadv.c
@@ -183,8 +183,8 @@ int read_adv(const char *path, const char *cfg)
     struct stat st;
     int err = 0;
 
-    err = asprintf(&file, "%s%s%s",
-	path, path[0] && path[strlen(path) - 1] == '/' ? "" : "/", cfg);
+    asprintf(&file, "%s%s%s",
+	     path, path[0] && path[strlen(path) - 1] == '/' ? "" : "/", cfg);
 
     if (!file) {
 	perror(program);
@@ -217,8 +217,8 @@ int read_adv(const char *path, const char *cfg)
 
     if (fd >= 0)
 	close(fd);
-    if (file)
-	free(file);
+
+    free(file);
 
     return err;
 }



More information about the Syslinux-commits mailing list