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

libdpkg: Use format precision instead of strnlen() in convert_string()

Guillem Jover лет назад: 15
Родитель
Сommit
21e9a2d3ce
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      lib/dpkg/fields.c

+ 1 - 2
lib/dpkg/fields.c

@@ -47,8 +47,7 @@ convert_string(struct parsedb_state *ps, const struct pkginfo *pigp,
   nvip = namevalue_find_by_name(ivip, startp);
   nvip = namevalue_find_by_name(ivip, startp);
   if (nvip == NULL) {
   if (nvip == NULL) {
     if (otherwise != -1) return otherwise;
     if (otherwise != -1) return otherwise;
-    parse_error(ps, pigp, _("`%.*s' is not allowed for %s"),
-                (int)strnlen(startp, 50), startp, what);
+    parse_error(ps, pigp, _("'%.50s' is not allowed for %s"), startp, what);
   }
   }
 
 
   ep = startp + nvip->length;
   ep = startp + nvip->length;