On Sun, Apr 12, 2015 at 08:29:55AM +0000, noname wrote:
> ---
>  st.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/st.c b/st.c
> index 109122e..f183803 100644
> --- a/st.c
> +++ b/st.c
> @@ -2788,10 +2788,8 @@ tresize(int col, int row) {
>               free(term.line[i]);
>               free(term.alt[i]);
>       }
> -     if(i > 0) {
> -             memmove(term.line, term.line + i, row * sizeof(Line));
> -             memmove(term.alt, term.alt + i, row * sizeof(Line));
> -     }
> +     memmove(term.line, term.line + i, row * sizeof(Line));
> +     memmove(term.alt, term.alt + i, row * sizeof(Line));

I was thinking about this option too but in that case you would be
calling memmove with an identical src and dst when i == 0. The man page
for glibc memmove(3) does not mention anything about this being a noop
so I am not sure that is a good thing to do.



>       for(i += row; i < term.row; i++) {
>               free(term.line[i]);
>               free(term.alt[i]);
> -- 
> 1.8.4
> 
> 

Reply via email to