From 9e6bb604f1efaf491fa8998d8965b11669b1373c Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 6 Aug 2012 16:39:03 +0200 Subject: when parsing a format file, check whether each line could be read completely, otherwise throw error * arbitrary limit (1024 bytes) per line - reading lines of arbritrary length is difficult and will be seldomly used * introduced is_newline() helper function --- lib/gtk-experiment-widgets/gtk-experiment-transcript-private.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/gtk-experiment-widgets/gtk-experiment-transcript-private.h') diff --git a/lib/gtk-experiment-widgets/gtk-experiment-transcript-private.h b/lib/gtk-experiment-widgets/gtk-experiment-transcript-private.h index 42cbc98..aaf7e37 100644 --- a/lib/gtk-experiment-widgets/gtk-experiment-transcript-private.h +++ b/lib/gtk-experiment-widgets/gtk-experiment-transcript-private.h @@ -130,4 +130,11 @@ gtk_experiment_transcript_free_format(GtkExperimentTranscriptFormat *format) G_GNUC_INTERNAL void gtk_experiment_transcript_free_formats(GSList *formats); +/** @private */ +static inline gboolean +is_newline(gchar c) +{ + return c == '\r' || c == '\n'; +} + #endif -- cgit v1.2.3