[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: o_text_basic.c



  User: pbernaud
  Date: 06/10/17 06:02:27

  Modified:    .        o_text_basic.c
  Log:
  Fixed Bug#1578416: crash when loading a symbol or a schematic with accent
  
  
  
  
  Revision  Changes    Path
  1.23      +6 -3      eda/geda/gaf/libgeda/src/o_text_basic.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: o_text_basic.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_text_basic.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -b -r1.22 -r1.23
  --- o_text_basic.c	23 Jul 2006 18:30:25 -0000	1.22
  +++ o_text_basic.c	17 Oct 2006 10:02:27 -0000	1.23
  @@ -415,7 +415,7 @@
     int last_char_width;
     gboolean overbar_started = FALSE;
     gchar *ptr;
  -  gchar *aux_string;
  +  gchar aux_string[7];
     OBJECT *o_font_set;
     gunichar c=0, previous_char = 0, next_char = 0;
     int escapes_counter = 0;
  @@ -597,9 +597,12 @@
   	 next_char = g_utf8_get_char_validated(g_utf8_find_next_char (ptr, NULL),-1)) {
       /* Keep track of the previous character and its width.
          They will be used in the overbar and escape characters */
  -    aux_string = g_strdup_printf("%c", previous_char);
  +    /*   - build a char string out of the gunichar previous_char */
  +    gint l = g_unichar_to_utf8 (previous_char, aux_string);
  +    /*   - end the string */
  +    aux_string[l] = '\0';
  +    /*   - finally get the width of the previous character */
       last_char_width = o_text_width(w_current, aux_string, size/2);
  -    g_free(aux_string);
   
       c = g_utf8_get_char_validated (ptr, -1);
   
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs