From 69f8e8d277f3edd02d44ac1452d9471a5fedf2f1 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 3 May 2010 15:12:19 +0000 Subject: Move read_line() further down so that it can be used in checkwps and remove checkwps' copy if it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25793 a1c6a512-1295-4272-9138-f99709370657 --- tools/checkwps/checkwps.c | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'tools') diff --git a/tools/checkwps/checkwps.c b/tools/checkwps/checkwps.c index 32d7ef16fd..6760d6215e 100644 --- a/tools/checkwps/checkwps.c +++ b/tools/checkwps/checkwps.c @@ -98,36 +98,6 @@ unsigned int htole32(unsigned int x) } #endif -int read_line(int fd, char* buffer, int buffer_size) -{ - int count = 0; - int num_read = 0; - - errno = 0; - - while (count < buffer_size) - { - unsigned char c; - - if (1 != read(fd, &c, 1)) - break; - - num_read++; - - if ( c == '\n' ) - break; - - if ( c == '\r' ) - continue; - - buffer[count++] = c; - } - - buffer[MIN(count, buffer_size - 1)] = 0; - - return errno ? -1 : num_read; -} - int recalc_dimension(struct dim *dst, struct dim *src) { return 0; -- cgit v1.2.3