Line 158... |
Line 158... |
} else if (nr > 0) {
|
} else if (nr > 0) {
|
usbp->write(lb.m_buf, nr);
|
usbp->write(lb.m_buf, nr);
|
} for(int i=0; i<nr; i++) {
|
} for(int i=0; i<nr; i++) {
|
lb.m_oline[lb.m_olen++] = lb.m_buf[i];
|
lb.m_oline[lb.m_olen++] = lb.m_buf[i];
|
assert(lb.m_buf[i] != '\0');
|
assert(lb.m_buf[i] != '\0');
|
if ((lb.m_oline[lb.m_olen-1]=='\n')||(lb.m_oline[lb.m_olen-1]=='\r')||(lb.m_olen >= (int)sizeof(lb.m_oline)-1)) {
|
if ((lb.m_oline[lb.m_olen-1]=='\n')
|
|
||(lb.m_oline[lb.m_olen-1]=='\r')
|
|
||(lb.m_olen >= (int)sizeof(lb.m_oline)-1)) {
|
if (lb.m_olen >= (int)sizeof(lb.m_oline)-1)
|
if (lb.m_olen >= (int)sizeof(lb.m_oline)-1)
|
lb.m_oline[lb.m_olen] = '\0';
|
lb.m_oline[lb.m_olen] = '\0';
|
else
|
else
|
lb.m_oline[lb.m_olen-1] = '\0';
|
lb.m_oline[lb.m_olen-1] = '\0';
|
if (lb.m_olen > 1)
|
if (lb.m_olen > 1)
|
Line 186... |
Line 188... |
// Return our result if we have a network
|
// Return our result if we have a network
|
// connection
|
// connection
|
write(confd, lb.m_buf, nr);
|
write(confd, lb.m_buf, nr);
|
} for(int i=0; i<nr; i++) {
|
} for(int i=0; i<nr; i++) {
|
lb.m_iline[lb.m_ilen++] = lb.m_buf[i];
|
lb.m_iline[lb.m_ilen++] = lb.m_buf[i];
|
if ((lb.m_iline[lb.m_ilen-1]=='\n')||(lb.m_iline[lb.m_ilen-1]=='\r')||(lb.m_ilen>=sizeof(lb.m_iline)-1)) {
|
if ((lb.m_iline[lb.m_ilen-1]=='\n')
|
if (lb.m_ilen >= sizeof(lb.m_iline)-1)
|
||(lb.m_iline[lb.m_ilen-1]=='\r')
|
|
||(lb.m_ilen >= (int)sizeof(lb.m_iline)-1)) {
|
|
if (lb.m_ilen >= (int)sizeof(lb.m_iline)-1)
|
lb.m_iline[lb.m_ilen] = '\0';
|
lb.m_iline[lb.m_ilen] = '\0';
|
else
|
else
|
lb.m_iline[lb.m_ilen-1] = '\0';
|
lb.m_iline[lb.m_ilen-1] = '\0';
|
if (lb.m_ilen > 1)
|
if (lb.m_ilen > 1)
|
printf("%c %s\n",
|
printf("%c %s\n",
|