Re: [PATCH i18n 01/11] Add three convenient format printing functions with \n automatically appended

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

 



2012/4/16 Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>:
> +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");
<snip>
> +               ret += fprintf(fp, "\n");

Apart from Jonathan's comment, isn't [f]printf a big hammer for this?
Wouldn't putchar / fputc be a tad more light-weight (and perhaps
clearer)?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]