strcpy(p, path); 
strncpy(p, path, PATH_MAX - (p - tmp) - 1); tmp[PATH_MAX-1] = '\0'; 
static char *expandDir(char *path, DirPath *full) {  static char tmp[PATH_MAX];  static char newfull[PATH_MAX];  char *p, *tail;  p = path;  if (path == NULL) {    strcpy(tmp, "/");    full->dirname = tmp;    full->basename = NULL;    strcpy(newfull, tmp); return newfull;  } else if (*p != '~' && NULL == (tail = strrchr(path, '/'))) {    p = tmp;    strcpy(p, basepath);    full->dirname = p;    while (*p++ != '\0') ;    strcpy(p, path);    snprintf(newfull,sizeof(newfull),"%s/%s", basepath, path);    full->basename = p; return newfull;  }  if (*p  == '/') {    strcpy(tmp, path);  } else {    if (*p == '~') {      struct passwd *pw;      p++;      if (*p == '/' || *p == '\0') {        pw = getpwuid(getuid());      } else {        char buf[80], *bp = buf;        while (*p != '/' && *p != '\0') *bp++ = *p++;        *bp = '\0';        pw = getpwnam(buf);      }      if (pw == NULL) {        ctl->cmsg(CMSG_WARNING, VERB_NORMAL,                  "something wrong with getting path."); return NULL;      }      while (*p == '/') p++;      snprintf(tmp, sizeof(tmp), "%s/%s", pw->pw_dir, p);    } else {    /* *p != '~' */      snprintf(tmp, sizeof(tmp), "%s/%s", basepath, path);    }  }  p = canonicalize_path(tmp);  tail = strrchr(p, '/'); *tail++ = '\0';  full->dirname = p;  full->basename = tail;  snprintf(newfull,sizeof(newfull),"%s/%s", p, tail);  return newfull;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/361cc5df1e14516b0a3eef7766539860da9a9721/xaw_i.c/buggy/interface/xaw_i.c