aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2008-07-18 08:43:18 -0500
committerRob Landley <rob@landley.net>2008-07-18 08:43:18 -0500
commite824ed1b5a1d7a6c839348cf4636ceb9972e7a11 (patch)
tree5ae3bcc44c57fa31dd328a2b2be03caedb963eff
parentf15387d8d3a383cd83f4bae8eb4c7dc6a15210d5 (diff)
downloadtoybox-e824ed1b5a1d7a6c839348cf4636ceb9972e7a11.tar.gz
Tweak from Roberto Foglietta.
-rw-r--r--lib/lib.c2
-rw-r--r--lib/lib.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/lib.c b/lib/lib.c
index d1568932..8f742894 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -550,7 +550,7 @@ char *readfile(char *name)
if (fd == -1) return 0;
len = fdlength(fd);
buf = xmalloc(len+1);
- buf[xread(fd, buf, len)] = 0;
+ buf[xreadall(fd, buf, len)] = 0;
return buf;
}
diff --git a/lib/lib.h b/lib/lib.h
index db283cf3..cfbeeb3a 100644
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -73,6 +73,8 @@ ssize_t writeall(int fd, void *buf, size_t len);
size_t xread(int fd, void *buf, size_t len);
void xreadall(int fd, void *buf, size_t len);
void xwrite(int fd, void *buf, size_t len);
+char *readfile(char *name);
+char *xreadfile(char *name);
char *xgetcwd(void);
void xstat(char *path, struct stat *st);
char *xabspath(char *path);