From 7cbaacfc388eeaa49aeced6e9dd9fde8d9110050 Mon Sep 17 00:00:00 2001
From: Wiebe Cazemier <wiebe@halfgaar.net>
Date: Wed, 2 Aug 2023 14:59:43 +0200
Subject: [PATCH] Fix missing speed category and possible crash

The function calc_rate can set units to 4, but that was outside the
bounds of the array of strings.
---
 src/retr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/retr.c b/src/retr.c
index 38c9fcfe..de920122 100644
--- a/src/retr.c
+++ b/src/retr.c
@@ -776,8 +776,8 @@ const char *
 retr_rate (wgint bytes, double secs)
 {
   static char res[20];
-  static const char *rate_names[] = {"B/s", "KB/s", "MB/s", "GB/s" };
-  static const char *rate_names_bits[] = {"b/s", "Kb/s", "Mb/s", "Gb/s" };
+  static const char *rate_names[] = {"B/s", "KB/s", "MB/s", "GB/s", "TB/s" };
+  static const char *rate_names_bits[] = {"b/s", "Kb/s", "Mb/s", "Gb/s", "Tb/s" };
   int units;
 
   double dlrate = calc_rate (bytes, secs, &units);
-- 
2.25.1

