Commit d3fb79b0 d3fb79b049f20b7d430f530c5bfc4b221960c8cc by Sergey Poznyakoff

Use x[mc]alloc() instead of util_[cm]alloc().

1 parent c3c88289
......@@ -99,7 +99,7 @@ alias_rehash()
return 1;
}
aliases = util_calloc(hash_size[hash_num], sizeof (aliases[0]));
aliases = xcalloc(hash_size[hash_num], sizeof (aliases[0]));
if (old_aliases)
{
for (i = 0; i < hash_size[hash_num-1]; i++)
......
......@@ -72,7 +72,7 @@ mail_set_my_name (char *name)
my_name = strdup (name);
gethostname(hostname, sizeof(hostname));
hostname[sizeof(hostname)-1] = 0;
my_email = util_malloc (strlen (name) + strlen (hostname) + 2);
my_email = xmalloc (strlen (name) + strlen (hostname) + 2);
sprintf (my_email, "%s@%s", name, hostname);
}
......
......@@ -73,7 +73,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
int len;
char *home = getenv("HOME");
len = strlen (home) + strlen ("/mbox") + 1;
args->file = util_malloc(len * sizeof (char));
args->file = xmalloc(len * sizeof (char));
strcpy (args->file, home);
strcat (args->file, "/mbox");
}
......@@ -401,7 +401,7 @@ mail_mainloop(char *(*input) __P((void *, int)), void *closure, int do_history)
break;
}
command[len-1] = '\0';
buf = util_malloc ((len + strlen (command2)) * sizeof (char));
buf = xmalloc ((len + strlen (command2)) * sizeof (char));
strcpy (buf, command);
strcat (buf, command2);
free (command);
......
......@@ -470,7 +470,7 @@ readline (const char *prompt)
fflush (ofile);
}
p = line = util_calloc (1, 255);
p = line = xcalloc (1, 255);
alloclen = 255;
linelen = 0;
for (;;)
......
......@@ -48,7 +48,7 @@ mail_shell (int argc, char **argv)
char *buf = NULL;
/* 1(shell) + 1 (-c) + 1(arg) + 1 (null) = 4 */
argvec = util_malloc (4 * (sizeof (char *)));
argvec = xmalloc (4 * (sizeof (char *)));
argcv_string (argc-1, &argv[1], &buf);
......
......@@ -31,7 +31,7 @@ mail_unset (int argc, char **argv)
int status = 0, i = 1;
for (i=1; i < argc; i++)
{
char *buf = util_malloc ((7+strlen (argv[i])) * sizeof (char));
char *buf = xmalloc ((7+strlen (argv[i])) * sizeof (char));
strcpy (buf, "set no");
strcat (buf, argv[i]);
if (!util_do_command (buf))
......
......@@ -430,7 +430,7 @@ var_pipe(int argc, char **argv, struct send_environ *env)
close(fd);
/* Execute the process */
xargv = util_calloc(argc, sizeof(xargv[0]));
xargv = xcalloc(argc, sizeof(xargv[0]));
for (i = 0; i < argc-1; i++)
xargv[i] = argv[i+1];
xargv[i] = NULL;
......