Просмотр исходного кода

Assign directly to l_r instead of a temporary variable

Guillem Jover лет назад: 18
Родитель
Сommit
19f7c15e9a
2 измененных файлов с 7 добавлено и 3 удалено
  1. 5 0
      ChangeLog
  2. 2 3
      src/pkg-show.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-08-03  Guillem Jover  <guillem@debian.org>
+
+	* src/pkg-show.c (limiteddescription): Assign directly to l_r instead
+	of a temporary variable.
+
 2008-08-03  Guillem Jover  <guillem@debian.org>
 
 	* utils/start-stop-daemon.c: Move the different implementations

+ 2 - 3
src/pkg-show.c

@@ -32,7 +32,6 @@ limiteddescription(struct pkginfo *pkg,
                    int maxl, const char **pdesc_r, int *l_r)
 {
 	const char *pdesc, *p;
-	int l;
 
 	pdesc = pkg->installed.valid ? pkg->installed.description : NULL;
 	if (!pdesc)
@@ -40,8 +39,8 @@ limiteddescription(struct pkginfo *pkg,
 	p = strchr(pdesc, '\n');
 	if (!p)
 		p = pdesc + strlen(pdesc);
-	l = min(p - pdesc, maxl);
+
+	*l_r = min(p - pdesc, maxl);
 	*pdesc_r = pdesc;
-	*l_r = l;
 }