Explorar el Código

libdpkg: Remove second va_copy in varbufvprintf

We can directly use args in the second vsnprintf as we are about to
return.
Guillem Jover hace 16 años
padre
commit
0969a91ef9
Se han modificado 1 ficheros con 1 adiciones y 4 borrados
  1. 1 4
      lib/dpkg/varbuf.c

+ 1 - 4
lib/dpkg/varbuf.c

@@ -81,10 +81,7 @@ varbufvprintf(struct varbuf *v, const char *fmt, va_list args)
 
   varbuf_grow(v, needed + 1);
 
-  va_copy(args_copy, args);
-  r = vsnprintf(v->buf + v->used, needed + 1, fmt, args_copy);
-  va_end(args_copy);
-
+  r = vsnprintf(v->buf + v->used, needed + 1, fmt, args);
   if (r < 0)
     ohshite(_("error formatting string into varbuf variable"));