[Groonga-commit] groonga/groonga-normalizer-mysql [master] Name the max number of normalized characters

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Feb 3 08:29:39 JST 2013


Kouhei Sutou	2013-02-03 08:29:39 +0900 (Sun, 03 Feb 2013)

  New Revision: 1fb02040fc1765943c751e4dfdac58b064372374
  https://github.com/groonga/groonga-normalizer-mysql/commit/1fb02040fc1765943c751e4dfdac58b064372374

  Log:
    Name the max number of normalized characters

  Modified files:
    normalizers/mysql.c

  Modified: normalizers/mysql.c (+2 -1)
===================================================================
--- normalizers/mysql.c    2013-02-02 23:50:08 +0900 (46b8881)
+++ normalizers/mysql.c    2013-02-03 08:29:39 +0900 (6c2b2c1)
@@ -1633,7 +1633,8 @@ normalize(grn_ctx *ctx, grn_obj *string)
   initial_data_size = original_length_in_bytes * 3;
   normalized = GRN_PLUGIN_MALLOC(ctx, initial_data_size + 1);
   if (flags & GRN_STRING_WITH_TYPES) {
-    types = GRN_PLUGIN_MALLOC(ctx, initial_data_size + 1);
+    unsigned int max_normalized_n_characters = original_length_in_bytes;
+    types = GRN_PLUGIN_MALLOC(ctx, max_normalized_n_characters);
     current_type = types;
   }
   rest = original;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index