Navigation Menu

Skip to content

Commit

Permalink
Suppress a warning
Browse files Browse the repository at this point in the history
    ha_mroonga.cpp: In member function 'int ha_mroonga::drop_index(MRN_SHARE*, uint)':
    ha_mroonga.cpp:8595:26: warning: 'target_name_length' may be used uninitialized in this function [-Wmaybe-uninitialized]
                  ctx->errbuf);
                              ^
  • Loading branch information
kou committed Feb 13, 2015
1 parent 6878d35 commit b174157
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ha_mroonga.cpp
Expand Up @@ -2,7 +2,7 @@
/*
Copyright(C) 2010 Tetsuro IKEDA
Copyright(C) 2010-2013 Kentoku SHIBA
Copyright(C) 2011-2014 Kouhei Sutou <kou@clear-code.com>
Copyright(C) 2011-2015 Kouhei Sutou <kou@clear-code.com>
Copyright(C) 2013 Kenji Maruyama <mmmaru777@gmail.com>
This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -8557,7 +8557,8 @@ int ha_mroonga::drop_index(MRN_SHARE *target_share, uint key_index)
const char *table_name = target_share->index_table[key_index];
snprintf(target_name, GRN_TABLE_MAX_KEY_SIZE,
"%s.%s", table_name, key_info[key_index].name);
grn_obj *index_column = grn_ctx_get(ctx, target_name, strlen(target_name));
target_name_length = strlen(target_name);
grn_obj *index_column = grn_ctx_get(ctx, target_name, target_name_length);
if (index_column) {
rc = grn_obj_remove(ctx, index_column);
}
Expand All @@ -8572,6 +8573,8 @@ int ha_mroonga::drop_index(MRN_SHARE *target_share, uint key_index)
target_name_length = grn_obj_name(ctx, index_table,
target_name, GRN_TABLE_MAX_KEY_SIZE);
rc = grn_obj_remove(ctx, index_table);
} else {
target_name_length = 0;
}
}

Expand Down

0 comments on commit b174157

Please sign in to comment.