$OpenBSD: patch-gtk_proto_draw_c,v 1.1 2003/11/04 17:42:44 jakob Exp $
--- gtk/proto_draw.c.orig	2003-11-04 00:24:40.000000000 +0100
+++ gtk/proto_draw.c	2003-11-04 18:08:45.000000000 +0100
@@ -1058,6 +1058,7 @@ packet_hex_print_common(GtkTextView *bv,
       /* Have we gone from reverse to plain? */
       if (reverse && (reverse != newreverse)) {
         convline = g_locale_to_utf8(line, cur, NULL, &newsize, NULL);
+        if (convline == NULL) convline = g_strndup (line, cur);
         gtk_text_buffer_insert_with_tags_by_name(buf, &iter, convline, newsize,
                                                  revstyle, NULL);
         g_free(convline);
@@ -1072,6 +1073,7 @@ packet_hex_print_common(GtkTextView *bv,
       /* Have we gone from plain to reversed? */
       if (!reverse && (reverse != newreverse)) {
         convline = g_locale_to_utf8(line, cur, NULL, &newsize, NULL);
+        if (convline == NULL) convline = g_strndup (line, cur);
         gtk_text_buffer_insert_with_tags_by_name(buf, &iter, convline, newsize,
                                                  "plain", NULL);
         g_free(convline);
@@ -1081,6 +1083,7 @@ packet_hex_print_common(GtkTextView *bv,
     }
     /* Print remaining part of line */
     convline = g_locale_to_utf8(line, cur, NULL, &newsize, NULL);
+    if (convline == NULL) convline = g_strndup (line, cur);
     gtk_text_buffer_insert_with_tags_by_name(buf, &iter, convline, newsize,
                                              reverse ? revstyle : "plain",
                                              NULL);
