diff options
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 26 |
1 files changed, 13 insertions, 13 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) | |||
143 | } | 143 | } |
144 | 144 | ||
145 | /* Same as safe_file_name, but returns an allocated copy. */ | 145 | /* Same as safe_file_name, but returns an allocated copy. */ |
146 | char * | 146 | char * |
147 | safe_file_name_alloc (const char *file_name) | 147 | safe_file_name_alloc (const char *file_name) |
148 | { | 148 | { |
149 | char *s = xstrdup (file_name); | 149 | char *s = grecs_strdup (file_name); |
150 | char *ns = safe_file_name (s); | 150 | char *ns = safe_file_name (s); |
151 | if (!ns) | 151 | if (!ns) |
152 | free (s); | 152 | free (s); |
153 | return ns; | 153 | return ns; |
154 | } | 154 | } |
155 | 155 | ||
@@ -546,14 +546,14 @@ cb_sql_host (enum grecs_callback_command cmd, | |||
546 | if (p) | 546 | if (p) |
547 | { | 547 | { |
548 | /* FIXME: Modifies constant string */ | 548 | /* FIXME: Modifies constant string */ |
549 | *p++ = 0; | 549 | *p++ = 0; |
550 | if (p[0] == '/') | 550 | if (p[0] == '/') |
551 | { | 551 | { |
552 | pconn->socket = xstrdup (p); | 552 | pconn->socket = grecs_strdup (p); |
553 | pconn->host = xstrdup ("localhost"); | 553 | pconn->host = grecs_strdup ("localhost"); |
554 | } | 554 | } |
555 | else | 555 | else |
556 | { | 556 | { |
557 | char *end; | 557 | char *end; |
558 | unsigned long n = strtoul (p, &end, 10); | 558 | unsigned long n = strtoul (p, &end, 10); |
559 | if (*end) | 559 | if (*end) |
@@ -566,17 +566,17 @@ cb_sql_host (enum grecs_callback_command cmd, | |||
566 | grecs_error (locus, 0, _("port number out of range 1..%d"), | 566 | grecs_error (locus, 0, _("port number out of range 1..%d"), |
567 | USHRT_MAX); | 567 | USHRT_MAX); |
568 | return 0; | 568 | return 0; |
569 | } | 569 | } |
570 | pconn->port = n; | 570 | pconn->port = n; |
571 | /* Save host name */ | 571 | /* Save host name */ |
572 | pconn->host = xstrdup (value->v.string); | 572 | pconn->host = grecs_strdup (value->v.string); |
573 | } | 573 | } |
574 | } | 574 | } |
575 | else | 575 | else |
576 | pconn->host = xstrdup (value->v.string); | 576 | pconn->host = grecs_strdup (value->v.string); |
577 | return 0; | 577 | return 0; |
578 | } | 578 | } |
579 | 579 | ||
580 | static int | 580 | static int |
581 | cb_sql (enum grecs_callback_command cmd, | 581 | cb_sql (enum grecs_callback_command cmd, |
582 | grecs_locus_t *locus, | 582 | grecs_locus_t *locus, |
@@ -591,13 +591,13 @@ cb_sql (enum grecs_callback_command cmd, | |||
591 | case grecs_callback_section_begin: | 591 | case grecs_callback_section_begin: |
592 | if (!value || value->type != GRECS_TYPE_STRING) | 592 | if (!value || value->type != GRECS_TYPE_STRING) |
593 | { | 593 | { |
594 | grecs_error(locus, 0, _("tag must be a string")); | 594 | grecs_error(locus, 0, _("tag must be a string")); |
595 | return 0; | 595 | return 0; |
596 | } | 596 | } |
597 | pconn = xzalloc (sizeof (*pconn)); | 597 | pconn = grecs_zalloc (sizeof (*pconn)); |
598 | pconn->ident = strdup (value->v.string); | 598 | pconn->ident = strdup (value->v.string); |
599 | *pdata = pconn; | 599 | *pdata = pconn; |
600 | break; | 600 | break; |
601 | 601 | ||
602 | case grecs_callback_section_end: | 602 | case grecs_callback_section_end: |
603 | pconn = *pdata; | 603 | pconn = *pdata; |
@@ -893,13 +893,13 @@ cb_notify_event (enum grecs_callback_command cmd, | |||
893 | { | 893 | { |
894 | struct notification *ntf; | 894 | struct notification *ntf; |
895 | void **pdata = cb_data; | 895 | void **pdata = cb_data; |
896 | 896 | ||
897 | switch (cmd) { | 897 | switch (cmd) { |
898 | case grecs_callback_section_begin: | 898 | case grecs_callback_section_begin: |
899 | ntf = xzalloc (sizeof (*ntf)); | 899 | ntf = grecs_zalloc (sizeof (*ntf)); |
900 | *pdata = ntf; | 900 | *pdata = ntf; |
901 | break; | 901 | break; |
902 | 902 | ||
903 | case grecs_callback_section_end: | 903 | case grecs_callback_section_end: |
904 | ntf = *pdata; | 904 | ntf = *pdata; |
905 | if (!ntf->msg) | 905 | if (!ntf->msg) |
@@ -981,22 +981,22 @@ cb_dictionary_params (enum grecs_callback_command cmd, | |||
981 | else | 981 | else |
982 | { | 982 | { |
983 | int i; | 983 | int i; |
984 | struct grecs_list_entry *ep; | 984 | struct grecs_list_entry *ep; |
985 | 985 | ||
986 | meth->parmc = size; | 986 | meth->parmc = size; |
987 | meth->parmv = xcalloc (size + 1, sizeof (meth->parmv[0])); | 987 | meth->parmv = grecs_calloc (size + 1, sizeof (meth->parmv[0])); |
988 | 988 | ||
989 | for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++) | 989 | for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++) |
990 | { | 990 | { |
991 | const grecs_value_t *vp = ep->data; | 991 | const grecs_value_t *vp = ep->data; |
992 | 992 | ||
993 | if (assert_string_arg (locus, cmd, vp)) | 993 | if (assert_string_arg (locus, cmd, vp)) |
994 | break; | 994 | break; |
995 | 995 | ||
996 | meth->parmv[i] = xstrdup (vp->v.string); | 996 | meth->parmv[i] = grecs_strdup (vp->v.string); |
997 | } | 997 | } |
998 | meth->parmv[i] = NULL; | 998 | meth->parmv[i] = NULL; |
999 | } | 999 | } |
1000 | return 0; | 1000 | return 0; |
1001 | } | 1001 | } |
1002 | 1002 | ||
@@ -1156,14 +1156,14 @@ cb_spool (enum grecs_callback_command cmd, | |||
1156 | case grecs_callback_section_begin: | 1156 | case grecs_callback_section_begin: |
1157 | if (!value || value->type != GRECS_TYPE_STRING) | 1157 | if (!value || value->type != GRECS_TYPE_STRING) |
1158 | { | 1158 | { |
1159 | grecs_error (locus, 0, _("tag must be a string")); | 1159 | grecs_error (locus, 0, _("tag must be a string")); |
1160 | return 1; | 1160 | return 1; |
1161 | } | 1161 | } |
1162 | spool = xzalloc (sizeof (*spool)); | 1162 | spool = grecs_zalloc (sizeof (*spool)); |
1163 | spool->tag = xstrdup (value->v.string); | 1163 | spool->tag = grecs_strdup (value->v.string); |
1164 | spool->file_sweep_time = file_sweep_time; | 1164 | spool->file_sweep_time = file_sweep_time; |
1165 | for (i = 0; i < NITEMS (spool->dictionary); i++) | 1165 | for (i = 0; i < NITEMS (spool->dictionary); i++) |
1166 | spool->dictionary[i] = default_dictionary[i]; | 1166 | spool->dictionary[i] = default_dictionary[i]; |
1167 | spool->archive = default_archive_descr; | 1167 | spool->archive = default_archive_descr; |
1168 | *pdata = spool; | 1168 | *pdata = spool; |
1169 | break; | 1169 | break; |
@@ -1274,14 +1274,14 @@ cb_supp_groups (enum grecs_callback_command cmd, | |||
1274 | wydawca_supp_groups = NULL; | 1274 | wydawca_supp_groups = NULL; |
1275 | else | 1275 | else |
1276 | { | 1276 | { |
1277 | int i; | 1277 | int i; |
1278 | struct grecs_list_entry *ep; | 1278 | struct grecs_list_entry *ep; |
1279 | 1279 | ||
1280 | wydawca_supp_groups = xcalloc (wydawca_supp_groupc, | 1280 | wydawca_supp_groups = grecs_calloc (wydawca_supp_groupc, |
1281 | sizeof (wydawca_supp_groups[0])); | 1281 | sizeof (wydawca_supp_groups[0])); |
1282 | 1282 | ||
1283 | for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++) | 1283 | for (i = 0, ep = value->v.list->head; ep; ep = ep->next, i++) |
1284 | { | 1284 | { |
1285 | const grecs_value_t *vp = ep->data; | 1285 | const grecs_value_t *vp = ep->data; |
1286 | struct group *grp; | 1286 | struct group *grp; |
1287 | 1287 | ||