Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: PATCH: zasprintf



> +
> +    *strp = buf;
> +    return strlen(buf);


It is wrong IIRC in case of (v|)snprintf. snprintf may leave buffer not
NULL-terminated in case of overflow. Even worse is, that there seems to be no
standard return value to indicate overflow (some systems return -1; some
buffer length. There was very interesting comment from Mark Crispin on
c-client list recently). And some systems (mine including) do not even
document snprintf.

Somehow I agree with Bart - if we can avoid it, let's avoid it.

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author