From ce16d9a26df7a3012945ecaa5738cf63110fb5c5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 19 Jul 2002 04:00:21 +0000 Subject: fixed line buffer mode in XFILE thanks to tim for finding this bug (This used to be commit 91bff7545405ba88bc721f358ccdbf0aac0e3ba6) --- source3/lib/xfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/xfile.c') diff --git a/source3/lib/xfile.c b/source3/lib/xfile.c index 903dfb1ae0..b5710f3a39 100644 --- a/source3/lib/xfile.c +++ b/source3/lib/xfile.c @@ -171,7 +171,7 @@ int x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f) flush a bit more than necessary, but that is harmless */ if (f->buftype == X_IOLBF && f->bufused) { int i; - for (i=size-1; i>=0; i--) { + for (i=(size*nmemb)-1; i>=0; i--) { if (*(i+(const char *)p) == '\n') { x_fflush(f); break; -- cgit