Change from returning through a pointer argument to returning it from the function return value.
@@ -29,8 +29,8 @@
#include <dpkg/dpkg-db.h>
#include <dpkg/pkg-show.h>
-void
-pkg_summary(struct pkginfo *pkg, const char **pdesc_r, int *len_ret)
+const char *
+pkg_summary(struct pkginfo *pkg, int *len_ret)
{
const char *pdesc;
size_t len;
@@ -44,6 +44,7 @@ pkg_summary(struct pkginfo *pkg, const char **pdesc_r, int *len_ret)
len = strlen(pdesc);
*len_ret = len;
- *pdesc_r = pdesc;
+
+ return pdesc;
}
@@ -26,7 +26,7 @@
DPKG_BEGIN_DECLS
-void pkg_summary(struct pkginfo *pkg, const char **pdesc_ret, int *len_ret);
+const char *pkg_summary(struct pkginfo *pkg, int *len_ret);
DPKG_END_DECLS
@@ -120,7 +120,7 @@ static void describebriefly(struct pkginfo *pkg) {
l= strlen(pkg->name);
if (l>20) maxl -= (l-20);
- pkg_summary(pkg, &pdesc, &l);
+ pdesc = pkg_summary(pkg, &l);
l = min(l, maxl);
printf(" %-20s %.*s\n",pkg->name,l,pdesc);
@@ -125,7 +125,7 @@ Desired=Unknown/Install/Remove/Purge/Hold\n\
*head = true;
l = min(l, dw);
printf(format,