#include "libpspp/pool.h"
#include "libpspp/str.h"
-#include "gl/intprops.h"
#include "gl/minmax.h"
#include "gl/xalloc.h"
#include "gl/xmemdup0.h"
ds_put_vformat (&text, msg, args);
va_end (args);
- struct msg m = {
+ struct msg *m = xmalloc (sizeof *m);
+ *m = (struct msg) {
.category = MSG_C_GENERAL,
.severity = MSG_S_ERROR,
- .text = ds_cstr (&text),
+ .text = ds_steal_cstr (&text),
};
- msg_emit (&m);
+ msg_emit (m);
r->ok = false;
ds_put_vformat (&text, msg, args);
va_end (args);
- struct msg m = {
+ struct msg *m = xmalloc (sizeof *m);
+ *m = (struct msg) {
.category = MSG_C_GENERAL,
.severity = MSG_S_WARNING,
- .text = ds_cstr (&text),
+ .text = ds_steal_cstr (&text),
};
- msg_emit (&m);
+ msg_emit (m);
}
/* Close and destroy R.
unsigned long int i;
for (i = 1; ; i++)
{
- char try_name[8 + 1 + INT_STRLEN_BOUND (i) + 1];
- sprintf (try_name, "%s_%lu", name, i);
+ char *try_name = xasprintf ("%s_%lu", name, i);
v = dict_create_var (dict, try_name, width);
+ free (try_name);
if (v != NULL)
break;
}
int width = caseproto_get_width (r->proto, i);
if (width == 0)
- case_data_rw_idx (c, i)->f = read_float (r);
+ *case_num_rw_idx (c, i) = read_float (r);
else
{
uint8_t buf[256];