projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PsppireVarView: Use g_realloc instead of xrealloc
[pspp]
/
src
/
language
/
dictionary
/
vector.c
diff --git
a/src/language/dictionary/vector.c
b/src/language/dictionary/vector.c
index 512ec3c2bfeaf99cde80aae28644b08f55225b1a..28e97b15d8aa9643475dfdbbcd1d964d164ebc3c 100644
(file)
--- a/
src/language/dictionary/vector.c
+++ b/
src/language/dictionary/vector.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2010, 2011, 2012
, 2016
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-136,8
+136,7
@@
cmd_vector (struct lexer *lexer, struct dataset *ds)
{
seen_format = true;
if (!parse_format_specifier (lexer, &format)
{
seen_format = true;
if (!parse_format_specifier (lexer, &format)
- || !fmt_check_output (&format)
- || !fmt_check_type_compat (&format, VAL_NUMERIC))
+ || !fmt_check_output (&format))
goto fail;
}
else
goto fail;
}
else
@@
-168,8
+167,8
@@
cmd_vector (struct lexer *lexer, struct dataset *ds)
}
if (dict_lookup_var (dict, name))
{
}
if (dict_lookup_var (dict, name))
{
- free (name);
msg (SE, _("%s is an existing variable name."), name);
msg (SE, _("%s is an existing variable name."), name);
+ free (name);
goto fail;
}
free (name);
goto fail;
}
free (name);
@@
-184,7
+183,8
@@
cmd_vector (struct lexer *lexer, struct dataset *ds)
for (j = 0; j < var_cnt; j++)
{
char *name = xasprintf ("%s%d", vectors[i], j + 1);
for (j = 0; j < var_cnt; j++)
{
char *name = xasprintf ("%s%d", vectors[i], j + 1);
- vars[j] = dict_create_var_assert (dict, name, 0);
+ vars[j] = dict_create_var_assert (dict, name,
+ fmt_var_width (&format));
var_set_both_formats (vars[j], &format);
free (name);
}
var_set_both_formats (vars[j], &format);
free (name);
}