Commit 45728df2 authored by Cedric Roux's avatar Cedric Roux

bugfix: wrong index

parent 2e64d54e
...@@ -484,17 +484,18 @@ void database_get_generic_description(void *_d, int id, ...@@ -484,17 +484,18 @@ void database_get_generic_description(void *_d, int id,
char **name, char **desc) char **name, char **desc)
{ {
database *d = _d; database *d = _d;
int pos = d->id_to_pos[id];
OBUF o; OBUF o;
int i; int i;
*name = strdup(d->i[id].name); *name = strdup(d->i[pos].name); if (*name == NULL) abort();
o.osize = o.omaxsize = 0; o.osize = o.omaxsize = 0;
o.obuf = NULL; o.obuf = NULL;
PUTS(&o, *name); PUTS(&o, *name);
for (i = 0; i < d->i[id].asize; i++) { for (i = 0; i < d->i[pos].asize; i++) {
PUTC(&o, ' '); PUTC(&o, ' ');
PUTS(&o, d->i[id].arg_name[i]); PUTS(&o, d->i[pos].arg_name[i]);
PUTS(&o, " ["); PUTS(&o, " [");
PUTS(&o, d->i[id].arg_name[i]); PUTS(&o, d->i[pos].arg_name[i]);
PUTS(&o, "]"); PUTS(&o, "]");
} }
PUTC(&o, 0); PUTC(&o, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment