From 688ec9217662849ba5f558b8132648e96567c80c Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 15 Apr 2021 07:59:50 +0000 Subject: library: replace all uses of getcwd() with slbt_realpath(). --- src/helper/slbt_archive_import.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/helper') diff --git a/src/helper/slbt_archive_import.c b/src/helper/slbt_archive_import.c index 071654f..6b861bc 100644 --- a/src/helper/slbt_archive_import.c +++ b/src/helper/slbt_archive_import.c @@ -38,7 +38,7 @@ static char * slbt_mri_argument( if (arg[0] == '/') target = arg; else { - if (!(getcwd(mricwd,sizeof(mricwd)))) + if (slbt_realpath(fdat,".",O_DIRECTORY,mricwd,sizeof(mricwd))) return 0; if ((size_t)snprintf(dstbuf,sizeof(dstbuf),"%s/%s", @@ -131,6 +131,10 @@ int slbt_archive_import( dst = slbt_mri_argument(fdcwd,dstarchive,mridst); src = slbt_mri_argument(fdcwd,srcarchive,mrisrc); + + if (!dst || !src) + return SLBT_SYSTEM_ERROR(dctx,0); + fmt = "OPEN %s\n" "ADDLIB %s\n" "SAVE\n" -- cgit v1.2.3