if (currentchar - txt2print >= strlen(txt2print)) break;
if ((size_t) (currentchar - txt2print) >= strlen(txt2print)) break;
static void print_result(gchar *txt2print, int result_offset, gchar *searchstrg) {  gchar *strg_to_roff;  glong strlen_to_roff;  gchar *currentchar;  gchar *kana_start;  gchar *exp_start;  GtkTextMark *linestart;  GtkTextIter startmatch, endmatch;  linestart = gtk_text_buffer_create_mark(GTK_TEXT_BUFFER(wordDic->text_results_buffer), "linestart", &wordDic->iter, TRUE);  strg_to_roff = (gchar *) g_strndup(txt2print, result_offset);  strlen_to_roff = g_utf8_strlen(strg_to_roff, -1);    currentchar = txt2print;  while (g_unichar_isspace(*currentchar) == FALSE) { // find first space    if (currentchar - txt2print >= strlen(txt2print)) break;    currentchar = g_utf8_next_char(currentchar);  }    //print out japanese word  if (gjitenApp->conf->bigwords == FALSE) {    gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, txt2print, currentchar - txt2print);   }  else {    gtk_text_buffer_insert_with_tags_by_name(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, txt2print, 																						 currentchar - txt2print, "largefont", NULL);  }    currentchar = g_utf8_next_char(currentchar);  if (*(currentchar) == '[')  { //we have a kana reading    gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, " (", 2);    currentchar = kana_start = g_utf8_next_char(currentchar);    while(*(currentchar) != ']') { //find ending ]      currentchar = g_utf8_next_char(currentchar);    }    gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, kana_start, currentchar - kana_start); //print out kana reading    gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, ") ", 2);    currentchar += 3;  }  else {    gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, " ", 1); // insert space     currentchar++;  }  while ((currentchar < txt2print + strlen(txt2print)) && (*currentchar != '\n')) {    exp_start = currentchar;    while ((*currentchar != '/')) {       currentchar = g_utf8_next_char(currentchar);      }    gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, exp_start, currentchar - exp_start); //print out expression    gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, "; ", 2);    currentchar++;  }  gtk_text_buffer_insert(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &wordDic->iter, "\n", 1); // insert linebreak  //find searchstrg matches in the line we print and highlight it.  gtk_text_buffer_get_iter_at_mark(GTK_TEXT_BUFFER(wordDic->text_results_buffer), &endmatch, linestart);    while (gtk_text_iter_forward_search(&endmatch, searchstrg, 0, &startmatch, &endmatch, &wordDic->iter) == TRUE) {    gtk_text_buffer_apply_tag_by_name(GTK_TEXT_BUFFER(wordDic->text_results_buffer), 																			"blue_foreground", &startmatch, &endmatch);  }} 