From d9408bb55f2c833de361cef1153c615d2874e7c6 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 9 Jun 2010 18:28:34 -0700 Subject: [PATCH] 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 --- libinstaller/setadv.c | 8 ++++---- 1 file 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; } -- 2.7.4