* desc.c (iocb_cmd_lookup): Make command table constant.
Reduce size of static char buffer.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
static const char *
iocb_cmd_lookup(unsigned cmd, enum iocb_sub *sub)
{
- static char buf[64];
- static struct {
+ static char buf[sizeof("%u /* SUB_??? */") + sizeof(int)*3];
+ static const struct {
const char *name;
enum iocb_sub sub;
} cmds[] = {
return cmds[cmd].name;
}
*sub = SUB_NONE;
- snprintf(buf, sizeof(buf), "%u /* SUB_??? */", cmd);
+ sprintf(buf, "%u /* SUB_??? */", cmd);
return buf;
}