- p = bsearch(name, applet_names, ARRAY_SIZE(applet_main), 1, applet_name_compare);
- if (!p)
- return -1;
- return p - applet_names;
+ p = bsearch(name, (void*)(ptrdiff_t)1, ARRAY_SIZE(applet_main), 1, applet_name_compare);
+ /*
+ * if (!p) return -1;
+ * ^^^^^^^^^^^^^^^^^^ the code below will do this if p == NULL :)
+ */
+ return (int)(ptrdiff_t)p - 1;