49a50 > static int span_max_chan_pos; 202,209c203,210 < memset(tabits,32, s[span].totalchans); < memset(tbbits,32, s[span].totalchans); < memset(rabits,32, s[span].totalchans); < memset(rbbits,32, s[span].totalchans); < memset(tcbits,32, s[span].totalchans); < memset(tdbits,32, s[span].totalchans); < memset(rcbits,32, s[span].totalchans); < memset(rdbits,32, s[span].totalchans); --- > memset(tabits,32, span_max_chan_pos); > memset(tbbits,32, span_max_chan_pos); > memset(rabits,32, span_max_chan_pos); > memset(rbbits,32, span_max_chan_pos); > memset(tcbits,32, span_max_chan_pos); > memset(tdbits,32, span_max_chan_pos); > memset(rcbits,32, span_max_chan_pos); > memset(rdbits,32, span_max_chan_pos); 340,342c341,343 < char s1[] = " 1111111111222222222333"; < char s2[] = "1234567890123456789012345789012"; < int max; --- > char s1[] = " 1111111111222222222233"; > char s2[] = "1234567890123456789012345678901"; > int x; 367,369c368,380 < max = s[span].totalchans; < if (max > 32) < max = 32; --- > span_max_chan_pos = s[span].totalchans; > for (x=0;x ZT_PARAMS zp; > int res; > memset(&zp, 0, sizeof(zp)); > zp.channo = x; > res = ioctl(ctl, ZT_GET_PARAMS, &zp); > if (!res && zp.spanno == span && zp.chanpos > span_max_chan_pos ) > span_max_chan_pos = zp.chanpos; > } > > if (span_max_chan_pos > 32) > span_max_chan_pos = 32; 371,372c382,383 < s1[max] = '\0'; < s2[max] = '\0'; --- > s1[span_max_chan_pos] = '\0'; > s2[span_max_chan_pos] = '\0'; 374c385 < bitbox = newtTextbox(8,10,max,9,0); --- > bitbox = newtTextbox(8,10,span_max_chan_pos,9,0); 484a496 > span_max_chan_pos = 0;