-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
/* Wrapper functions with error checking for standard functions. */
extern void *xmalloc (size_t n);
+extern void *xcalloc (size_t n, size_t s);
/* Prototypes for local functions. */
static void error_print (void);
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
return strdup (gettext ("\
-Report bugs using the `glibcbug' script to <bugs@gnu.ai.mit.edu>.\n"));
+Report bugs using the `glibcbug' script to <bugs@gnu.org>.\n"));
default:
break;
}
/* If we haven't seen anything yet, allocate result structure. */
if (current == NULL)
{
- current = (struct catalog *) xmalloc (sizeof (*current));
-
- current->all_sets = NULL;
- current->total_messages = 0;
- current->last_set = 0;
- current->current_set = find_set (current, NL_SETD);
+ current = (struct catalog *) xcalloc (1, sizeof (*current));
#define obstack_chunk_alloc malloc
#define obstack_chunk_free free
obstack_init (¤t->mem_pool);
+
+ current->current_set = find_set (current, NL_SETD);
}
buf = NULL;
#define out. But we have to take care for the set
not having a symbolic name. */
if (message_run->symbol != NULL)
- if (set_run->symbol == NULL)
- fprintf (fp, "#define AutomaticSet%d%s %#x\t/* %s:%Zu */\n",
- set_run->number, message_run->symbol,
- message_run->number, message_run->fname,
- message_run->line);
- else
- fprintf (fp, "#define %s%s %#x\t/* %s:%Zu */\n",
- set_run->symbol, message_run->symbol,
- message_run->number, message_run->fname,
- message_run->line);
+ {
+ if (set_run->symbol == NULL)
+ fprintf (fp, "#define AutomaticSet%d%s %#x\t/* %s:%Zu */\n",
+ set_run->number, message_run->symbol,
+ message_run->number, message_run->fname,
+ message_run->line);
+ else
+ fprintf (fp, "#define %s%s %#x\t/* %s:%Zu */\n",
+ set_run->symbol, message_run->symbol,
+ message_run->number, message_run->fname,
+ message_run->line);
+ }
message_run = message_run->next;
}
result = result->next;
/* Prepare new message set. */
- result = (struct set_list *) xmalloc (sizeof (*result));
+ result = (struct set_list *) xcalloc (1, sizeof (*result));
result->number = number;
- result->deleted = 0;
- result->messages = NULL;
result->next = current->all_sets;
current->all_sets = result;
__open_catalog (&old_cat_obj);
if (old_cat_obj.status != mmapped && old_cat_obj.status != malloced)
- if (errno == ENOENT)
- /* No problem, the catalog simply does not exist. */
- return;
- else
- error (EXIT_FAILURE, errno, gettext ("while opening old catalog file"));
+ {
+ if (errno == ENOENT)
+ /* No problem, the catalog simply does not exist. */
+ return;
+ else
+ error (EXIT_FAILURE, errno, gettext ("while opening old catalog file"));
+ }
/* OK, we have the catalog loaded. Now read all messages and merge
them. When set and message number clash for any message the new