case OPTTYPE_KEYMAP:
str = malloc(1 + sizeof "submenu");
strcpy(str, "submenu");
return str;
There isn't a good reason for this not to be return strdup("submenu");
is there? case OPTTYPE_KEYMAP:
str = malloc(1 + sizeof "submenu");
strcpy(str, "submenu");
return str;
There isn't a good reason for this not to be return strdup("submenu");
is there?That's unnecessary. But then again I can't really blame them. It isn't always clear when you have to do that. Also a previous version might have used strlen() instead of sizeof.