Convert simple uses of alloca/strcpy to LOCAL_COPY.

git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@232 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Tim Cava
2013-02-24 07:32:59 +00:00
parent a7c93a3950
commit d7a0c781f8
13 changed files with 19 additions and 38 deletions

View File

@@ -196,8 +196,7 @@ char *new_path, *p;
int count = 0;
int doit = 0;
new_path = alloca(strlen(path)+1);
strcpy(new_path, path);
new_path = LOCAL_COPY(path);
if ((p = strrchr(new_path, '/')))
*p = 0;
if (!(dptr = opendir(new_path)))
@@ -247,8 +246,7 @@ struct dirent *dir;
struct stat st;
char *ret = NULL, *p;
int count = 0;
new_path = alloca(strlen(path)+1);
strcpy(new_path, path);
new_path = LOCAL_COPY(path);
if ((p = strrchr(new_path, '/')))
*p = 0;
else
@@ -274,8 +272,7 @@ int count = 0;
if (name)
{
char *pid, *n_tty, *h_name;
pid = alloca(strlen(p)+1);
strcpy(pid, p);
pid = LOCAL_COPY(p);
n_tty = strchr(pid, '.'); *n_tty++ = 0;
h_name = strchr(n_tty, '.'); *h_name++ = 0;
if (strcmp(name, pid))