rem: static char path[32], sbuf[512];
add: static char path[32], sbuf[1024];
context: proc_t* readproc(PROCTAB* PT, proc_t* rbuf) {    static struct direct *ent;		/* dirent handle */    static struct stat sb;		/* stat buffer */    static char path[32], sbuf[512];	/* bufs for stat,statm */    int allocated = 0, matched = 0;	/* flags */    proc_t *p = NULL;    /* loop until a proc matching restrictions is found or no more processes */    /* I know this could be a while loop -- this way is easier to indent ;-) */next_proc:				/* get next PID for consideration *//*printf("PT->flags is 0x%08x\n", PT->flags);*/#define flags (PT->flags)    if (Do(PID)) {	if (!*PT->pids)			/* set to next item in pids */	    return NULL;	sprintf(path, "/proc/%d", *(PT->pids)++);	matched = 1;    } else {					/* get next numeric /proc ent */	while ((ent = readdir(PT->procfs)) &&	       (*ent->d_name < '0' || *ent->d_name > '9'))	    ;	if (!ent || !ent->d_name)	    return NULL;	sprintf(path, "/proc/%s", ent->d_name);    }    if (stat(path, &sb) == -1)		/* no such dirent (anymore) */	goto next_proc;    if (Do(UID) && !XinLN(uid_t, sb.st_uid, PT->uids, PT->nuid))	goto next_proc;			/* not one of the requested uids */    if (!allocated) {				 /* assign mem for return buf */	p = rbuf ? rbuf : xcalloc(p, sizeof *p); /* passed buf or alloced mem */	allocated = 1;				 /* remember space is set up */    }    p->euid = sb.st_uid;			/* need a way to get real uid */    if ((file2str(path, "stat", sbuf, sizeof sbuf)) == -1)	goto next_proc;			/* error reading /proc/#/stat */    stat2proc(sbuf, p);				/* parse /proc/#/stat */    if (!matched && Do(TTY) && !XinL(dev_t, p->tty, PT->ttys))	goto next_proc;			/* not one of the requested ttys */    if (!matched && Do(ANYTTY) && p->tty == -1)	goto next_proc;			/* no controlling terminal */    if (!matched && Do(STAT) && !strchr(PT->stats,p->state))	goto next_proc;			/* not one of the requested states */    if (Do(FILLMEM)) {				/* read, parse /proc/#/statm */	if ((file2str(path, "statm", sbuf, sizeof sbuf)) != -1 )	    statm2proc(sbuf, p);		/* ignore statm errors here */    }						/* statm fields just zero */    if (Do(FILLSTATUS)) {         /* read, parse /proc/#/status */       if ((file2str(path, "status", sbuf, sizeof sbuf)) != -1 ){           status2proc(sbuf, p, 0 /*FIXME*/);       }    }    /* some number->text resolving which is time consuming */    if (Do(FILLUSR)){	strncpy(p->euser,   user_from_uid(p->euid), sizeof p->euser);        strncpy(p->egroup, group_from_gid(p->egid), sizeof p->egroup);        if(Do(FILLSTATUS)) {            strncpy(p->ruser,   user_from_uid(p->ruid), sizeof p->ruser);            strncpy(p->rgroup, group_from_gid(p->rgid), sizeof p->rgroup);            strncpy(p->suser,   user_from_uid(p->suid), sizeof p->suser);            strncpy(p->sgroup, group_from_gid(p->sgid), sizeof p->sgroup);            strncpy(p->fuser,   user_from_uid(p->fuid), sizeof p->fuser);            strncpy(p->fgroup, group_from_gid(p->fgid), sizeof p->fgroup);        }    }    if (Do(FILLCMD))				/* read+parse /proc/#/cmdline */	p->cmdline = file2strvec(path, "cmdline");    if (Do(FILLENV))				/* read+parse /proc/#/environ */	p->environ = file2strvec(path, "environ");        if (p->state == 'Z')			/* fixup cmd for zombies */	strncat(p->cmd," <defunct>", sizeof p->cmd);    return p;}