aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/config.c b/src/config.c
index df9816e..8250749 100644
--- a/src/config.c
+++ b/src/config.c
@@ -143,13 +143,13 @@ safe_file_name (char *file_name)
}
/* Same as safe_file_name, but returns an allocated copy. */
char *
safe_file_name_alloc (const char *file_name)
{
- char *s = xstrdup (file_name);
+ char *s = grecs_strdup (file_name);
char *ns = safe_file_name (s);
if (!ns)
free (s);
return ns;
}
@@ -546,14 +546,14 @@ cb_sql_host (enum grecs_callback_command cmd,
if (p)
{
/* FIXME: Modifies constant string */
*p++ = 0;
if (p[0] == '/')
{
- pconn->socket = xstrdup (p);
- pconn->host = xstrdup ("localhost");
+ pconn->socket = grecs_strdup (p);
+ pconn->host = grecs_strdup ("localhost");
}
else
{
char *end;
unsigned long n = strtoul (p, &end, 10);
if (*end)
@@ -566,17 +566,17 @@ cb_sql_host (enum grecs_callback_command cmd,
grecs_error (locus, 0, _("port number out of range 1..%d"),
USHRT_MAX);
return 0;
}
pconn->port = n;
/* Save host name */
- pconn->host = xstrdup (value->v.string);
+ pconn->host = grecs_strdup (value->v.string);
}
}
else
- pconn->host = xstrdup (value->v.string);
+ pconn->host = grecs_strdup (value->v.string);
return 0;
}
static int
cb_sql (enum grecs_callback_command cmd,
grecs_locus_t *locus,
@@ -591,13 +591,13 @@ cb_sql (enum grecs_callback_command cmd,
case grecs_callback_section_begin:
if (!value || value->type != GRECS_TYPE_STRING)
{
grecs_error(locus, 0, _("tag must be a string"));
return 0;
}
- pconn = xzalloc (sizeof (*pconn));
+ pconn = grecs_zalloc (sizeof (*pconn));
pconn->ident = strdup (value->v.string);
*pdata = pconn;
break;
case grecs_callback_section_end:
pconn = *pdata;
@@ -893,13 +893,13 @@ cb_notify_event (enum grecs_callback_command cmd,
{
struct notification *ntf;
void **pdata = cb_data;
switch (cmd) {
case grecs_callback_section_begin:
- ntf = xzalloc (sizeof (*ntf));
+ ntf = grecs_zalloc (sizeof (*ntf));
*pdata = ntf;
break;
case grecs_callback_section_end:
ntf = *pdata;
if (!ntf->msg)
@@ -981,22 +981,22 @@ cb_dictionary_params (enum grecs_callback_command cmd,
else
{
int i;
struct grecs_list_entry *ep;
meth->parmc = size;
- meth->parmv = xcalloc (size + 1, sizeof (meth->parmv[0]));
+ meth->parmv = grecs_calloc (size + 1, sizeof (meth->parmv[0]));
for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++)
{
const grecs_value_t *vp = ep->data;
if (assert_string_arg (locus, cmd, vp))
break;
- meth->parmv[i] = xstrdup (vp->v.string);
+ meth->parmv[i] = grecs_strdup (vp->v.string);
}
meth->parmv[i] = NULL;
}
return 0;
}
@@ -1156,14 +1156,14 @@ cb_spool (enum grecs_callback_command cmd,
case grecs_callback_section_begin:
if (!value || value->type != GRECS_TYPE_STRING)
{
grecs_error (locus, 0, _("tag must be a string"));
return 1;
}
- spool = xzalloc (sizeof (*spool));
- spool->tag = xstrdup (value->v.string);
+ spool = grecs_zalloc (sizeof (*spool));
+ spool->tag = grecs_strdup (value->v.string);
spool->file_sweep_time = file_sweep_time;
for (i = 0; i < NITEMS (spool->dictionary); i++)
spool->dictionary[i] = default_dictionary[i];
spool->archive = default_archive_descr;
*pdata = spool;
break;
@@ -1274,13 +1274,13 @@ cb_supp_groups (enum grecs_callback_command cmd,
wydawca_supp_groups = NULL;
else
{
int i;
struct grecs_list_entry *ep;
- wydawca_supp_groups = xcalloc (wydawca_supp_groupc,
+ wydawca_supp_groups = grecs_calloc (wydawca_supp_groupc,
sizeof (wydawca_supp_groups[0]));
for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++)
{
const grecs_value_t *vp = ep->data;
struct group *grp;

Return to:

Send suggestions and report system problems to the System administrator.