summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-09-19 17:55:09 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-09-19 17:55:09 +0200
commit9600eaf3f16b6ba4358b15a1e152bdae8389a5cb (patch)
tree664ec027312862231e89a105c04615f1d310a852 /tools.c
parent0d85a30e61e662affc1d12a4c1ca71d8b7a8e94b (diff)
downloadvdr-9600eaf3f16b6ba4358b15a1e152bdae8389a5cb.tar.gz
vdr-9600eaf3f16b6ba4358b15a1e152bdae8389a5cb.tar.bz2
ReadString() now returns at end-of-line
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools.c b/tools.c
index 9196ae57..79d2ee6c 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.18 2000/09/17 15:36:33 kls Exp $
+ * $Id: tools.c 1.19 2000/09/19 17:55:09 kls Exp $
*/
#define _GNU_SOURCE
@@ -353,7 +353,7 @@ int cFile::ReadString(char *Buffer, int Size)
bool wait = true;
while (Ready(wait)) {
- int n = read(f, Buffer + rbytes, Size - rbytes);
+ int n = read(f, Buffer + rbytes, 1);
if (n == 0)
break; // EOF
if (n < 0) {
@@ -361,7 +361,7 @@ int cFile::ReadString(char *Buffer, int Size)
return -1;
}
rbytes += n;
- if (rbytes == Size)
+ if (rbytes == Size || Buffer[rbytes - 1] == '\n')
break;
wait = false;
}