From 9e2c14a7ca7a8ec6ebe5ee2972a52043b4ab0b71 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sat, 26 Nov 2011 17:53:45 +0100 Subject: [PATCH] Fix glyph caching We need to use memcmp() not memcpy() to compare two kmscon_char's. Signed-off-by: David Herrmann --- src/console_char.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/console_char.c b/src/console_char.c index b9a3c9a..079117e 100644 --- a/src/console_char.c +++ b/src/console_char.c @@ -212,7 +212,7 @@ static gboolean kmscon_char_equal(gconstpointer a, gconstpointer b) if (ch1->len != ch2->len) return FALSE; - return (memcpy(ch1->buf, ch2->buf, ch1->len) == 0); + return (memcmp(ch1->buf, ch2->buf, ch1->len) == 0); } /* @@ -463,7 +463,6 @@ static int kmscon_font_lookup(struct kmscon_font *font, g_hash_table_insert(font->glyphs, ch, glyph); } - kmscon_glyph_ref(glyph); *out = glyph; return 0; -- 2.7.4