pidgin/plugins/spellchk.c

branch
soc.2013.gobjectification
changeset 34892
65e25c679ca5
parent 34655
6a939719ea98
parent 34307
398577183905
child 34955
854143116575
child 36758
deee438dc431
equal deleted inserted replaced
34891:3882234d2097 34892:65e25c679ca5
123 gchar *lower = g_utf8_strdown(word, -1); 123 gchar *lower = g_utf8_strdown(word, -1);
124 gint bytes; 124 gint bytes;
125 gchar *ret; 125 gchar *ret;
126 126
127 bytes = g_unichar_to_utf8(g_unichar_toupper(g_utf8_get_char(word)), buf); 127 bytes = g_unichar_to_utf8(g_unichar_toupper(g_utf8_get_char(word)), buf);
128 buf[MIN(bytes, sizeof(buf) - 1)] = '\0'; 128 g_assert(bytes >= 0);
129 buf[MIN((gsize)bytes, sizeof(buf) - 1)] = '\0';
129 130
130 ret = g_strconcat(buf, g_utf8_offset_to_pointer(lower, 1), NULL); 131 ret = g_strconcat(buf, g_utf8_offset_to_pointer(lower, 1), NULL);
131 g_free(lower); 132 g_free(lower);
132 133
133 return ret; 134 return ret;
676 g_signal_connect(G_OBJECT(gtkconv->entry), "message_send", 677 g_signal_connect(G_OBJECT(gtkconv->entry), "message_send",
677 G_CALLBACK(message_send_cb), spell); 678 G_CALLBACK(message_send_cb), spell);
678 return; 679 return;
679 } 680 }
680 681
681 static int buf_get_line(char *ibuf, char **buf, int *position, gsize len) 682 static int buf_get_line(char *ibuf, char **buf, gsize *position, gsize len)
682 { 683 {
683 int pos = *position; 684 gsize pos = *position;
684 int spos = pos; 685 gsize spos = pos;
685 686
686 if (pos == len) 687 if (pos == len)
687 return 0; 688 return 0;
688 689
689 while (!(ibuf[pos] == '\n' || 690 while (!(ibuf[pos] == '\n' ||
1776 gchar *buf; 1777 gchar *buf;
1777 gchar *ibuf; 1778 gchar *ibuf;
1778 GHashTable *hashes; 1779 GHashTable *hashes;
1779 char bad[82] = ""; 1780 char bad[82] = "";
1780 char good[256] = ""; 1781 char good[256] = "";
1781 int pnt = 0; 1782 gsize pnt = 0;
1782 gsize size; 1783 gsize size;
1783 gboolean complete = TRUE; 1784 gboolean complete = TRUE;
1784 gboolean case_sensitive = FALSE; 1785 gboolean case_sensitive = FALSE;
1785 1786
1786 buf = g_build_filename(purple_user_dir(), "dict", NULL); 1787 buf = g_build_filename(purple_user_dir(), "dict", NULL);

mercurial