[Groonga-commit] groonga/groonga-normalizer-mysql at 1b89279 [master] Fix checks size

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jan 29 10:54:43 JST 2014


Kouhei Sutou	2014-01-29 10:54:43 +0900 (Wed, 29 Jan 2014)

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

  Message:
    Fix checks size
    
    It is an array of short.

  Modified files:
    normalizers/mysql.c

  Modified: normalizers/mysql.c (+2 -2)
===================================================================
--- normalizers/mysql.c    2014-01-29 00:11:08 +0900 (1f0bb4d)
+++ normalizers/mysql.c    2014-01-29 10:54:43 +0900 (e1820af)
@@ -322,8 +322,8 @@ normalize(grn_ctx *ctx, grn_obj *string,
     current_type = types;
   }
   if (flags & GRN_STRING_WITH_CHECKS) {
-    unsigned int max_normalized_length_in_bytes = original_length_in_bytes + 1;
-    checks = GRN_PLUGIN_MALLOC(ctx, max_normalized_length_in_bytes);
+    unsigned int max_checks_size = sizeof(short) * original_length_in_bytes + 1;
+    checks = GRN_PLUGIN_MALLOC(ctx, max_checks_size);
     current_check = checks;
     current_check[0] = 0;
   }
-------------- next part --------------
HTML����������������������������...
Download 



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