rem: if(!(pp->wchan & 0xffffff)) return snprintf(outbuf, max_rightward+1, "-"); return snprintf(outbuf, max_rightward+1, "%s", lookup_wchan(pp->wchan, pp->XXXID));
add: const char *w; size_t len; if(!(pp->wchan & 0xffffff)) return memcpy(outbuf,"-",2),1; w = lookup_wchan(pp->wchan, pp->XXXID); len = strlen(w); if(len>max_rightward) len=max_rightward; memcpy(outbuf, w, len); outbuf[len] = '\0'; return len;
context: static int pr_wname(char *restrict const outbuf, const proc_t *restrict const pp){/* SGI's IRIX always uses a number for "wchan", so "wname" is provided too. * * We use '-' for running processes, the location when there is * only one thread waiting in the kernel, and '*' when there is * more than one thread waiting in the kernel. * * The output should be truncated to maximal columns width -- overflow * is not supported for the "wchan". */    if(!(pp->wchan & 0xffffff)) return snprintf(outbuf, max_rightward+1, "-");    return snprintf(outbuf, max_rightward+1, "%s", lookup_wchan(pp->wchan, pp->XXXID));}