diff options
author | joerg@mysql.com <> | 2005-04-26 19:11:54 +0200 |
---|---|---|
committer | joerg@mysql.com <> | 2005-04-26 19:11:54 +0200 |
commit | a0cac19e6e246dc1078e6379f2e783cae6933fe0 (patch) | |
tree | 7d4bea1e0360d09b657e461828038f8d52bfb8b3 /mysys | |
parent | 1523119091522b364692dcb65e181d7e193d65ee (diff) | |
parent | 5624641cb08dfdc53d62111c5b8e184e515402b0 (diff) | |
download | mariadb-git-a0cac19e6e246dc1078e6379f2e783cae6933fe0.tar.gz |
Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/M50/mysql-5.0
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/charset.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mysys/charset.c b/mysys/charset.c index a4a8205a3f9..534a6aa998e 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -581,15 +581,15 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, { char escape=0; #ifdef USE_MB - int l; - if (use_mb_flag && (l= my_ismbchar(charset_info, from, end))) + int tmp_length; + if (use_mb_flag && (tmp_length= my_ismbchar(charset_info, from, end))) { - if (to + l >= to_end) + if (to + tmp_length > to_end) { overflow=1; break; } - while (l--) + while (tmp_length--) *to++= *from++; from--; continue; @@ -605,7 +605,7 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, multi-byte character into a valid one. For example, 0xbf27 is not a valid GBK character, but 0xbf5c is. (0x27 = ', 0x5c = \) */ - if (use_mb_flag && (l= my_mbcharlen(charset_info, *from)) > 1) + if (use_mb_flag && (tmp_length= my_mbcharlen(charset_info, *from)) > 1) escape= *from; else #endif @@ -634,7 +634,7 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, } if (escape) { - if (to + 2 >= to_end) + if (to + 2 > to_end) { overflow=1; break; @@ -644,7 +644,7 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, } else { - if (to + 1 >= to_end) + if (to + 1 > to_end) { overflow=1; break; |