summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-06-09 18:28:34 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-06-09 18:28:34 -0700
commitd9408bb55f2c833de361cef1153c615d2874e7c6 (patch)
tree6f6847f0b59b11fe478480365fbd274a838a9a0c
parent862845aea785a1b7eb52b9e23850d113a2098310 (diff)
downloadsyslinux-d9408bb55f2c833de361cef1153c615d2874e7c6.tar.gz
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@linux.intel.com>
-rw-r--r--libinstaller/setadv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libinstaller/setadv.c b/libinstaller/setadv.c
index 682b883e..c891b87f 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;
}