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

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 лет назад: 18
Родитель
Сommit
8ad47fe55e
2 измененных файлов с 6 добавлено и 1 удалено
  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>
 
 	* 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;
 
 		if (head->width>0)
-			snprintf(fmt,16,"%%%s%ds",
+			snprintf(fmt,16,"%%%s%zds",
 				((head->pad) ? "-" : ""), head->width);
 		else
 			strcpy(fmt, "%s");