/[pspp]/psppire/src/data_sheet.c
ViewVC logotype

Diff of /psppire/src/data_sheet.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by jmd, Sat Nov 12 07:52:06 2005 UTC revision 1.18 by jmd, Sun Nov 13 01:35:44 2005 UTC
# Line 332  value_format_func(gint row, gint col, co Line 332  value_format_func(gint row, gint col, co
332        g_assert(v->type == ALPHA);        g_assert(v->type == ALPHA);
333        const gchar* text = g_value_get_string(src);        const gchar* text = g_value_get_string(src);
334        if ( text)        if ( text)
335          memcpy(val->s, text, v->width);          {
336              memset(val->s, 0, v->width);
337              memcpy(val->s, text,
338                     v->width < strlen(text)? v->width : strlen(text));
339            }
340        else        else
341          goto lossage;          goto lossage;
342      }      }
# Line 509  psppire_create_system_file(GtkSheet *she Line 513  psppire_create_system_file(GtkSheet *she
513                g_assert(G_VALUE_HOLDS(&gval, G_TYPE_STRING));                g_assert(G_VALUE_HOLDS(&gval, G_TYPE_STRING));
514    
515                const gchar *text = g_value_get_string(&gval);                const gchar *text = g_value_get_string(&gval);
516                memset(value->s, 0, v->width);                memset(value->s, ' ', v->width);
517                if ( text )                if ( text )
518                  memcpy(value->s, text, strlen(text));                  {
519                      memcpy(value->s, text,
520                             strlen(text) < v->width ? strlen(text) : v->width);
521                    }
522              }              }
523            else            else
524              {              {

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26