diff -Nrup a/count.c b/count.c
--- a/count.c 2012-04-27 17:38:24.000000000 -0600
+++ b/count.c 2013-12-18 09:23:32.823289640 -0700
@@ -100,6 +100,16 @@ time_cmp(void *a, void *b)
static int
syscall_cmp(void *a, void *b)
{
+ const char *name_a = sysent[*((int *) a)].sys_name;
+ const char *name_b = sysent[*((int *) b)].sys_name;
+
+ if (name_a == name_b)
+ return 0;
+ if (!name_a)
+ return -1;
+ if (!name_b)
+ return 1;
+
return strcmp(sysent[*((int *) a)].sys_name,
sysent[*((int *) b)].sys_name);
}