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

dselect: Do not treat licensestring as a format string

This was spotted by a run with the clang++ static analyzer.
Guillem Jover лет назад: 14
Родитель
Сommit
3c3a1adfa0
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      dselect/main.cc

+ 2 - 3
dselect/main.cc

@@ -170,7 +170,7 @@ printversion(const struct cmdinfo *ci, const char *value)
 {
   printf(gettext(programdesc), DSELECT, DPKG_VERSION_ARCH);
   printf("%s", gettext(copyrightstring));
-  printf(gettext(licensestring), DSELECT);
+  printf("%s", gettext(licensestring));
 
   m_output(stdout, _("<standard output>"));
 
@@ -423,8 +423,7 @@ refreshmenu(void)
 
   attrset(A_NORMAL);
   addstr(gettext(copyrightstring));
-  sprintf(buf, gettext(licensestring), DSELECT);
-  addstr(buf);
+  addstr(gettext(licensestring));
 
   modstatdb_init();
   if (!modstatdb_can_lock())