Re: [PATCH i18n 01/11] Add three convenient format printing functions with \n automatically appended
Nguyễn Thái Ngọc Duy wrote:
Show 5 quoted lines
> printf("hello world\n");
>
> can be converted to
>
> printf_ln(_("hello world"));> --- a/strbuf.c
> +++ b/strbuf.c
> @@ -464,3 +464,36 @@ void strbuf_addstr_urlencode(struct strbuf *sb, const char *s,
Show 9 quoted lines
> +int printf_ln(const char *fmt, ...)
> +{
> + int ret;
> + va_list ap;
> + va_start(ap, fmt);
> + ret = vprintf(fmt, ap);
> + va_end(ap);
> + if (ret >= 0)
> + ret += printf("\n");What happens if the second printf fails?