From ed966c69210873eceb34d980ecf432a3111f9da5 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 13 May 2002 17:07:37 +0000 Subject: changed log domain and changed few g_return_if_fails to g_asserts. the domain change makes all glib warnings be printed into stderr instead of trying to print them into irssi window which most probably would just mysteriously crash. also irssi doesn't now crash if it thinks screen height is 0 :) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2787 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/textbuffer-view.c | 9 +++++++-- src/fe-text/textbuffer.c | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index dc21aae6..da69734e 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define G_LOG_DOMAIN "TextBufferView" + #include "module.h" #include "textbuffer-view.h" #include "utf8.h" @@ -713,6 +715,9 @@ static int view_scroll(TEXT_BUFFER_VIEW_REC *view, LINE_REC **lines, break; } + if ((*lines)->next == NULL) + break; + *lines = (*lines)->next; } @@ -879,8 +884,8 @@ LINE_CACHE_REC *textbuffer_view_get_line_cache(TEXT_BUFFER_VIEW_REC *view, { LINE_CACHE_REC *cache; - g_return_val_if_fail(view != NULL, NULL); - g_return_val_if_fail(line != NULL, NULL); + g_assert(view != NULL); + g_assert(line != NULL); cache = g_hash_table_lookup(view->cache->line_cache, line); if (cache == NULL) diff --git a/src/fe-text/textbuffer.c b/src/fe-text/textbuffer.c index ee11aa67..e989b8fd 100644 --- a/src/fe-text/textbuffer.c +++ b/src/fe-text/textbuffer.c @@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define G_LOG_DOMAIN "TextBuffer" + #include "module.h" #include "misc.h" #include "formats.h" -- cgit v1.2.3