summaryrefslogtreecommitdiff
path: root/source3/lib/util_file.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-02-24 03:09:08 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-02-24 03:09:08 +0000
commit266ec4aac04cb8666234f18baa38ff6387f40cb3 (patch)
tree4d9d7c402de541088943102072b26bba14d480d8 /source3/lib/util_file.c
parentecad7bea2cf9af30fa492ba943081275db16c0ee (diff)
downloadsamba-266ec4aac04cb8666234f18baa38ff6387f40cb3.tar.gz
samba-266ec4aac04cb8666234f18baa38ff6387f40cb3.tar.bz2
samba-266ec4aac04cb8666234f18baa38ff6387f40cb3.zip
Merge doxygen, signed/unsigned, const and other small fixes from HEAD to 3.0.
Andrew Bartlett (This used to be commit 9ef0d40c3f8aef52ab321dc065264c42065bc876)
Diffstat (limited to 'source3/lib/util_file.c')
-rw-r--r--source3/lib/util_file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c
index 611e0e40be..02acbd4d7e 100644
--- a/source3/lib/util_file.c
+++ b/source3/lib/util_file.c
@@ -362,7 +362,7 @@ char *file_pload(char *syscmd, size_t *size)
while ((n = read(fd, buf, sizeof(buf))) > 0) {
tp = Realloc(p, total + n + 1);
if (!tp) {
- DEBUG(0,("file_pload: failed to exand buffer!\n"));
+ DEBUG(0,("file_pload: failed to expand buffer!\n"));
close(fd);
SAFE_FREE(p);
return NULL;
@@ -372,6 +372,9 @@ char *file_pload(char *syscmd, size_t *size)
}
if (p) p[total] = 0;
+ /* FIXME: Perhaps ought to check that the command completed
+ * successfully (returned 0); if not the data may be
+ * truncated. */
sys_pclose(fd);
if (size) *size = total;
@@ -590,7 +593,7 @@ BOOL file_save(const char *fname, void *packet, size_t length)
if (fd == -1) {
return False;
}
- if (write(fd, packet, length) != length) {
+ if (write(fd, packet, length) != (size_t)length) {
return False;
}
close(fd);