Переглянути джерело

libdpkg: Change m_vasprintf() to assume it is more prone to succeed

Guillem Jover 13 роки тому
батько
коміт
24ee92a456
1 змінених файлів з 3 додано та 5 видалено
  1. 3 5
      lib/dpkg/mlib.c

+ 3 - 5
lib/dpkg/mlib.c

@@ -89,13 +89,11 @@ m_vasprintf(char **strp, const char *fmt, va_list args)
   int n;
 
   n = vasprintf(strp, fmt, args);
+  if (n >= 0)
+    return n;
 
   onerr_abort++;
-  if (n < 0)
-    ohshite(_("failed to allocate memory"));
-  onerr_abort--;
-
-  return n;
+  ohshite(_("failed to allocate memory"));
 }
 
 int