summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/copy_file.c2
-rw-r--r--libbb/lineedit.c2
-rw-r--r--libbb/simplify_path.c2
-rw-r--r--libbb/xgetcwd.c4
-rw-r--r--libbb/xreadlink.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index 632064e..bd785b7 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -233,7 +233,7 @@ int copy_file(const char *source, const char *dest, int flags)
} else if (S_ISLNK(source_stat.st_mode)) {
char *lpath;
- lpath = xreadlink(source);
+ lpath = xmalloc_readlink_or_warn(source);
if (symlink(lpath, dest) < 0) {
bb_perror_msg("cannot create symlink '%s'", dest);
free(lpath);
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 937d70d..16256f7 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -1090,7 +1090,7 @@ static void parse_prompt(const char *prmt_ptr)
size_t cur_prmt_len = 0;
char flg_not_length = '[';
char *prmt_mem_ptr = xzalloc(1);
- char *pwd_buf = xgetcwd(0);
+ char *pwd_buf = xrealloc_getcwd_or_warn(NULL);
char buf2[PATH_MAX + 1];
char buf[2];
char c;
diff --git a/libbb/simplify_path.c b/libbb/simplify_path.c
index b714c66..7e68e39 100644
--- a/libbb/simplify_path.c
+++ b/libbb/simplify_path.c
@@ -16,7 +16,7 @@ char *bb_simplify_path(const char *path)
if (path[0] == '/')
start = xstrdup(path);
else {
- s = xgetcwd(NULL);
+ s = xrealloc_getcwd_or_warn(NULL);
start = concat_path_file(s, path);
free(s);
}
diff --git a/libbb/xgetcwd.c b/libbb/xgetcwd.c
index 0ac450d..ec1d8f7 100644
--- a/libbb/xgetcwd.c
+++ b/libbb/xgetcwd.c
@@ -18,7 +18,7 @@
*/
char *
-xgetcwd(char *cwd)
+xrealloc_getcwd_or_warn(char *cwd)
{
char *ret;
unsigned path_max;
@@ -26,7 +26,7 @@ xgetcwd(char *cwd)
path_max = (unsigned) PATH_MAX;
path_max += 2; /* The getcwd docs say to do this. */
- if (cwd==0)
+ if (cwd == NULL)
cwd = xmalloc(path_max);
while ((ret = getcwd(cwd, path_max)) == NULL && errno == ERANGE) {
diff --git a/libbb/xreadlink.c b/libbb/xreadlink.c
index fb67cde..18a8b94 100644
--- a/libbb/xreadlink.c
+++ b/libbb/xreadlink.c
@@ -11,7 +11,7 @@
* yourself. You have been warned.
*/
-char *xreadlink(const char *path)
+char *xmalloc_readlink_or_warn(const char *path)
{
enum { GROWBY = 80 }; /* how large we will grow strings by */