- if(!(item = malloc(sizeof *item)))
- eprintf("cannot malloc %u bytes\n", sizeof *item);
- if(!(item->text = strdup(buf)))
- eprintf("cannot strdup %u bytes\n", strlen(buf)+1);
- item->next = item->left = item->right = NULL;
- inputw = MAX(inputw, textw(dc, item->text));
+ if(!(items[i].text = strdup(buf)))
+ eprintf("cannot strdup %u bytes:", strlen(buf)+1);
+ if(strlen(items[i].text) > max)
+ max = strlen(maxstr = items[i].text);