Merge "Simplify the abort() implementation." into main
diff --git a/libfdtrack/fdtrack.cpp b/libfdtrack/fdtrack.cpp
index 3627c84..e446f56 100644
--- a/libfdtrack/fdtrack.cpp
+++ b/libfdtrack/fdtrack.cpp
@@ -269,8 +269,10 @@
   if (fatal) {
     // Find the most common stack.
     size_t max = 0;
+    size_t total = 0;
     StackInfo* stack = nullptr;
     for (size_t i = 0; i < stacks.count; ++i) {
+      total += stacks.data[i].count;
       if (stacks.data[i].count > max) {
         stack = &stacks.data[i];
         max = stack->count;
@@ -287,7 +289,7 @@
       char* p = buf;
       p += async_safe_format_buffer(buf, sizeof(buf),
                                     "aborting due to fd leak: see \"open files\" in the tombstone; "
-                                    "most common stack (%zu/%zu) is\n", max, stacks.count);
+                                    "most common stack (%zu/%zu) is\n", max, total);
 
       for (size_t i = 0; i < stack->stack_depth; ++i) {
         ssize_t bytes_left = buf + sizeof(buf) - p;