[CRIU] [PATCH 0/7] New helpers for easy string construction
Stanislav Kinsburskiу
skinsbursky at odin.com
Thu Dec 17 00:18:17 PST 2015
17 дек. 2015 г. 9:10 AM пользователь Andrew Vagin <avagin at virtuozzo.com> написал:
>
> On Wed, Dec 16, 2015 at 06:32:57PM +0300, Stanislav Kinsburskiy wrote:
> > This patch set introduced new helpers add_to_string() and construct_string(),
> > which can be used to create or add to string a variable amount of parameters
> > in the way, like sprintf does, but including allocation of sufficient buffer
> > size.
>
> I don't like names of this functions. I can suggest xsprintf (like asprintf) and xstraddf.
>
Why these names are better?
> > They can be used instead of manual rellocation of some string for
> > concatenation or explicit allocation and printing.
> > This patch set (except the first one, introducing helpers) replaces only
> > realloc() calls and alloc()+sprintf() call, and reduces code base
> > for 37 lines wth improving it's readability.
> >
> > _______________________________________________
> > CRIU mailing list
> > CRIU at openvz.org
> > https://lists.openvz.org/mailman/listinfo/criu
More information about the CRIU
mailing list