lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev [dev.15] fixup patch: edit TEXTAREA


From: dickey
Subject: Re: lynx-dev [dev.15] fixup patch: edit TEXTAREA
Date: Fri, 29 Jan 1999 18:15:16 -0500 (EST)

> 
> The attached patch fixes a couple bugs that crept into the edit 
> TEXTAREA feature. 
...
mostly ok, but

why do you expect fread will return something with trailing nulls?

> -    while ((size != 0) && isspace(ebuf[size-1])) 
> +    while ((size != 0) && (isspace(ebuf[size-1]) || (ebuf[size-1] == '\0'))) 
>       ebuf[--size] = '\0'; 

or embedded nulls?

> -             *p = '\0'; 
> +     for (size = MAX_LINE, p = line + (size - 1); size != 0; p--, size--) { 
> +         if ((isspace(*p)) || (*p == '\0')) 
> +            *p = '\0'; 
>           else 
> -             break; 
> +            break; 
> +     } 

and (I didn't change this because it's not used), your substitution for
the "X" isn't ANSI (won't work except for pre-ANSI compilers).

>  /* usage: DUMPSTRUCT_ANCHOR(anchor_ptr, "message"); */ 
>  #define   DUMPSTRUCT_ANCHOR(A,X) \ 
>  CTRACE(tfp, "\n" \ 
...
> +            "KED:   anchor_ptr=0x%08x  sizeof=%d  ["X"]\n" \ 

-- 
Thomas E. Dickey
address@hidden
http://www.clark.net/pub/dickey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]