fix paranoia, chartorune never returns <=0

This commit is contained in:
cinap_lenrek 2011-05-13 02:49:40 +00:00
parent c7c882b4ae
commit bb45ddca85
3 changed files with 2 additions and 21 deletions

View file

@ -154,11 +154,6 @@ cgascreenputs(char* s, int n)
while(n > 0){
i = chartorune(&r, s);
if(i <= 0){
s++;
--n;
continue;
}
cgascreenputc(r);
s += i;
n -= i;

View file

@ -148,11 +148,6 @@ vgascreenputs(char* s, int n)
while(n > 0){
i = chartorune(&r, s);
if(i <= 0){
s++;
--n;
continue;
}
memmove(buf, s, i);
buf[i] = 0;
n -= i;

View file

@ -401,7 +401,7 @@ void
consproc(void *)
{
char *p, *e, *x, buf[64];
int n, i;
int n;
Rune r;
threadsetname("consproc");
@ -411,12 +411,7 @@ consproc(void *)
while((n = read(consfd, p, e - p)) > 0){
x = buf + n;
while(p < x && fullrune(p, x - p)){
i = chartorune(&r, p);
if(i <= 0){
p++;
continue;
}
p += i;
p += chartorune(&r, p);
if(r)
send(rawchan, &r);
}
@ -462,10 +457,6 @@ lineproc(void *aux)
int i;
i = chartorune(&x, s);
if(i <= 0){
s++;
continue;
}
s += i;
if(r == '\b'){
if(s >= p){