null+****@clear*****
null+****@clear*****
2012年 3月 13日 (火) 01:08:24 JST
Kouhei Sutou 2012-03-13 01:08:24 +0900 (Tue, 13 Mar 2012)
New Revision: fc6269bf3b66102a41e10204b9c32f074c40fda9
Log:
Use nstr->orig_blen instead of strlen()
Because nstr->orig isn't NULL terminated.
Modified files:
lib/str.c
Modified: lib/str.c (+1 -1)
===================================================================
--- lib/str.c 2012-03-12 21:17:11 +0900 (d0f084a)
+++ lib/str.c 2012-03-13 01:08:24 +0900 (7bb449d)
@@ -876,7 +876,7 @@ normalize_latin1(grn_ctx *ctx, grn_str *nstr)
const unsigned char *s, *s_, *e;
unsigned char *d, *d0, *d_;
uint_least8_t *cp, *ctypes, ctype;
- size_t size = strlen(nstr->orig), length = 0;
+ size_t size = nstr->orig_blen, length = 0;
int removeblankp = nstr->flags & GRN_STR_REMOVEBLANK;
if (!(nstr->norm = GRN_MALLOC(size + 1))) {
return GRN_NO_MEMORY_AVAILABLE;