summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 63ba04a..81e4d12 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -44,6 +44,7 @@
#include "file.h"
#include "errno.h"
#include "system.h"
+#include "misc.h"
#ifdef HAVE_LCD_BITMAP
#include "icons.h"
#include "font.h"
@@ -707,42 +708,6 @@ void settings_load(void)
settings_apply();
}
-/* Read (up to) a line of text from fd into buffer and return number of bytes
- * read (which may be larger than the number of bytes stored in buffer). If
- * an error occurs, -1 is returned (and buffer contains whatever could be
- * read). A line is terminated by a LF char. Neither LF nor CR chars are
- * stored in buffer.
- */
-static 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;
-}
-
/* parse a line from a configuration file. the line format is:
setting name: setting value