This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=6bca41b863e9ec137a8d415ed8cfdd57b6d1dd1e commit 6bca41b863e9ec137a8d415ed8cfdd57b6d1dd1e Author: Guillem Jover <[email protected]> AuthorDate: Tue Jan 23 12:29:30 2024 +0100 libdpkg: Rename r variables for printf()-like return values to n We are interested in the amount printed, not just its return code. --- lib/dpkg/varbuf.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/dpkg/varbuf.c b/lib/dpkg/varbuf.c index f4a581db8..a5d3d3193 100644 --- a/lib/dpkg/varbuf.c +++ b/lib/dpkg/varbuf.c @@ -177,7 +177,7 @@ int varbuf_vprintf(struct varbuf *v, const char *fmt, va_list args) { va_list args_copy; - int needed, r; + int needed, n; va_copy(args_copy, args); needed = vsnprintf(NULL, 0, fmt, args_copy); @@ -188,26 +188,26 @@ varbuf_vprintf(struct varbuf *v, const char *fmt, va_list args) varbuf_grow(v, needed + 1); - r = vsnprintf(v->buf + v->used, needed + 1, fmt, args); - if (r < 0) + n = vsnprintf(v->buf + v->used, needed + 1, fmt, args); + if (n < 0) ohshite(_("error formatting string into varbuf variable")); - v->used += r; + v->used += n; - return r; + return n; } int varbuf_printf(struct varbuf *v, const char *fmt, ...) { - int r; va_list args; + int n; va_start(args, fmt); - r = varbuf_vprintf(v, fmt, args); + n = varbuf_vprintf(v, fmt, args); va_end(args); - return r; + return n; } void -- Dpkg.Org's dpkg

