I'm not sure how I missed these in the recent commits, but there
you have it.
void
mnemon_fini (mnemon_t *mnemon)
{
void
mnemon_fini (mnemon_t *mnemon)
{
for (i = 0; i < mnemon->num_bins; i++)
bin_fini (&mnemon->bins[i]);
for (i = 0; i < mnemon->num_bins; i++)
bin_fini (&mnemon->bins[i]);
mnemon_get_category_if_exists (mnemon_t *mnemon,
const char *name)
{
mnemon_get_category_if_exists (mnemon_t *mnemon,
const char *name)
{
for (i = 0; i < mnemon->num_categories; i++)
if (strcmp (mnemon->categories[i].name, name) == 0)
for (i = 0; i < mnemon->num_categories; i++)
if (strcmp (mnemon->categories[i].name, name) == 0)
mnemon_get_bin (mnemon_t *mnemon,
int score)
{
mnemon_get_bin (mnemon_t *mnemon,
int score)
{
bin_t *bin;
for (i = 0; i < mnemon->num_bins; i++)
bin_t *bin;
for (i = 0; i < mnemon->num_bins; i++)
int line_count = 0;
char *path;
category_t *category;
int line_count = 0;
char *path;
category_t *category;
struct stat st;
path = xmalloc (strlen (mnemon->dir_name) + 1 + strlen (name) + 1);
struct stat st;
path = xmalloc (strlen (mnemon->dir_name) + 1 + strlen (name) + 1);
void
mnemon_save (mnemon_t *mnemon)
{
void
mnemon_save (mnemon_t *mnemon)
{
+ unsigned int i;
+ int err;
char *filename, *lock_filename;
FILE *file;
category_t *category;
char *filename, *lock_filename;
FILE *file;
category_t *category;
item_t *item)
{
category_t *category;
item_t *item)
{
category_t *category;
+ unsigned int i, item_index;
for (i = 0; i < mnemon->num_categories; i++) {
category = &mnemon->categories[i];
item_index = item - category->items;
for (i = 0; i < mnemon->num_categories; i++) {
category = &mnemon->categories[i];
item_index = item - category->items;
- if (item_index >= 0 && item_index < category->num_items)
+ if (item_index < category->num_items)