Parcourir la source

64bits fix: head->width is a size_t, needs %zd format.

* lib/showpkg.c (show1package): Use %zd instead of %d in sprintf()
call with a size_t parameter.
Pierre Habouzit il y a 18 ans
Parent
commit
8ad47fe55e
2 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 5 0
      ChangeLog
  2. 1 1
      lib/showpkg.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-05-11  Pierre Habouzit  <madcoder@debian.org>
+
+	* lib/showpkg.c (show1package): Use %zd instead of %d in sprintf()
+	call with a size_t parameter.
+
 2008-05-11  Pierre Habouzit  <madcoder@debian.org>
 2008-05-11  Pierre Habouzit  <madcoder@debian.org>
 
 
 	* scripts/update-alternatives.pl: add a --query option that works like
 	* scripts/update-alternatives.pl: add a --query option that works like

+ 1 - 1
lib/showpkg.c

@@ -216,7 +216,7 @@ void show1package(const struct lstitem* head, struct pkginfo *pkg) {
 		ok=0;
 		ok=0;
 
 
 		if (head->width>0)
 		if (head->width>0)
-			snprintf(fmt,16,"%%%s%ds",
+			snprintf(fmt,16,"%%%s%zds",
 				((head->pad) ? "-" : ""), head->width);
 				((head->pad) ? "-" : ""), head->width);
 		else
 		else
 			strcpy(fmt, "%s");
 			strcpy(fmt, "%s");