On Wed, 2017-05-17 at 15:54 +0200, Martin Wilck wrote:
>  #define ENDLINE \
> -             if (c > line) \
> -                     line[c - line - 1] = '\n'
> +             if (c > line) {                         \
> +                     if (c <= line + len - 1) {      \
> +                             *(c - 1) = '\n';        \
> +                             *c = '\0';              \
> +                     } else                          \
> +                             line[len - 1] = '\0';   \
> +             }

Hello Martin,

Please convert ENDLINE from a macro into a function. Functions are
easier to maintain than macros.

Thanks,

Bart.

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to