diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-02-22 12:22:06 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-02-22 12:22:06 +0000 |
commit | 7e110f782a55d4dca1fb3fedd95bf059c9ec0638 (patch) | |
tree | 2e27934bd9c23ed79a80d9ea4a02396cd0516b3c /source3/lib/xfile.c | |
parent | 0dde23a7b24edf1cbf4d7d7e5afea485e37498e5 (diff) | |
download | samba-7e110f782a55d4dca1fb3fedd95bf059c9ec0638.tar.gz samba-7e110f782a55d4dca1fb3fedd95bf059c9ec0638.tar.bz2 samba-7e110f782a55d4dca1fb3fedd95bf059c9ec0638.zip |
More signed/unsigned fixes (yes, I run with funny compiler options) and
make x_fwrite() match fwrite() in returning a size_t.
Andrew Bartlett
(This used to be commit 2943c695787b742e9a96b2eefe2d75f681bacf7c)
Diffstat (limited to 'source3/lib/xfile.c')
-rw-r--r-- | source3/lib/xfile.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/lib/xfile.c b/source3/lib/xfile.c index 57f3e27638..1534dd855e 100644 --- a/source3/lib/xfile.c +++ b/source3/lib/xfile.c @@ -140,9 +140,10 @@ int x_fclose(XFILE *f) } /* simulate fwrite() */ -int x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f) +size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f) { - int ret, total=0; + ssize_t ret; + size_t total=0; /* we might be writing unbuffered */ if (f->buftype == X_IONBF || @@ -154,7 +155,7 @@ int x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f) while (total < size*nmemb) { - int n = f->bufsize - f->bufused; + size_t n = f->bufsize - f->bufused; n = MIN(n, (size*nmemb)-total); if (n == 0) { |