summaryrefslogtreecommitdiff
path: root/extlinux/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'extlinux/main.c')
-rw-r--r--extlinux/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/extlinux/main.c b/extlinux/main.c
index 68e6457e..daebc101 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -350,12 +350,13 @@ int ext2_fat_install_file(const char *path, int devfd, struct stat *rst)
char *file, *oldfile;
int fd = -1, dirfd = -1;
int modbytes;
+ int r1, r2;
- asprintf(&file, "%s%sldlinux.sys",
- path, path[0] && path[strlen(path) - 1] == '/' ? "" : "/");
- asprintf(&oldfile, "%s%sextlinux.sys",
- path, path[0] && path[strlen(path) - 1] == '/' ? "" : "/");
- if (!file || !oldfile) {
+ r1 = asprintf(&file, "%s%sldlinux.sys",
+ path, path[0] && path[strlen(path) - 1] == '/' ? "" : "/");
+ r2 = asprintf(&oldfile, "%s%sextlinux.sys",
+ path, path[0] && path[strlen(path) - 1] == '/' ? "" : "/");
+ if (r1 < 0 || !file || r2 < 0 || !oldfile) {
perror(program);
return 1;
}