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

Diff of /psppire/src/callbacks.c

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

revision 1.11 by jmd, Sat Nov 12 07:52:06 2005 UTC revision 1.12 by jmd, Sun Nov 13 01:35:44 2005 UTC
# Line 155  on_open1_activate                      ( Line 155  on_open1_activate                      (
155            {            {
156              GValue val = {0};              GValue val = {0};
157              const struct variable *v = pspp_dict_get_var(dict, var_idx);              const struct variable *v = pspp_dict_get_var(dict, var_idx);
158              union value *value = case_data(&mycase, v->fv);              const union value *value = case_data(&mycase, v->fv);
159    
160              if ( v->type == ALPHA)              if ( v->type == ALPHA)
161                {                {
162                  gchar *text = g_malloc(sizeof (gchar) * (v->width + 1));                  gchar *text = g_malloc(sizeof (gchar) * (v->width + 1));
163                  g_value_init(&val, G_TYPE_STRING);                  g_value_init(&val, G_TYPE_STRING);
164                                    
165                    memset(text, 0, v->width + 1);
166                  memcpy(text, value->s, v->width);                  memcpy(text, value->s, v->width);
                 value->s[v->width] = '\0';  
167                            
168                  g_value_set_string(&val, text);                  g_value_set_string(&val, text);
169                  g_free(text);                  g_free(text);

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

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