diff -Nrup a/count.c b/count.c --- a/count.c 2014-09-17 15:18:18.000000000 -0400 +++ b/count.c 2015-07-02 21:48:48.906419324 -0400 @@ -115,6 +115,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); }