about summary refs log tree commit diff
path: root/cli/list.c
diff options
context:
space:
mode:
authorMarq Schneider <queueRAM@gmail.com>2010-08-13 10:55:14 -0500
committerMarq Schneider <queueRAM@gmail.com>2010-08-13 10:55:14 -0500
commita6328070d92c75396c941a6962f4553ee7f3f9c1 (patch)
tree4eae52c83f16f9b82632c894a4e4916cc772ba0d /cli/list.c
parent9667cf0694245ead296a4d79a1579448a625fd60 (diff)
downloadbtpd-a6328070d92c75396c941a6962f4553ee7f3f9c1.tar.gz
btpd-a6328070d92c75396c941a6962f4553ee7f3f9c1.zip
Added ARRAY_COUNT() macro to get number of elements in const arrays.
Diffstat (limited to 'cli/list.c')
-rw-r--r--cli/list.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/list.c b/cli/list.c
index ed346d2..f8659f3 100644
--- a/cli/list.c
+++ b/cli/list.c
@@ -1,4 +1,5 @@
 #include "btcli.h"
+#include "utils.h"
 
 void
 usage_list(void)
@@ -170,7 +171,7 @@ cmd_list(int argc, char **argv)
            IPC_TVAL_PCCOUNT, IPC_TVAL_PCSEEN, IPC_TVAL_PCGOT,   IPC_TVAL_SESSUP,
            IPC_TVAL_SESSDWN, IPC_TVAL_RATEUP, IPC_TVAL_RATEDWN, IPC_TVAL_IHASH,
            IPC_TVAL_DIR };
-    size_t nkeys = sizeof(keys) / sizeof(keys[0]);
+    size_t nkeys = ARRAY_COUNT(keys);
     struct items itms;
     while ((ch = getopt_long(argc, argv, "aif:", list_opts, NULL)) != -1) {
         switch (ch) {