[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: kernel32: Add UTF-7 support. (try 4)
From: Alexandre Julliard <julliard () winehq ! org>
Date: 2012-08-30 17:57:44
Message-ID: 876280i7on.fsf () wine ! dyndns ! org
[Download RAW message or body]
Alex Henrie <alexhenrie24@gmail.com> writes:
> + do
> + {
> + if (src[source_index] == 0 && srclen == -1)
> + {
> + if (dry_run) dest_index++; else if (write_to_w_string(dst, dstlen, \
> &dest_index, 0)) return -1; + /* when srclen=-1, terminate at the first \
> null character found */ + break;
> + }
> + else if (src[source_index] == '+')
> + {
> + WCHAR byte_pair = 0;
> + short offset = 0;
> +
> + source_index++; /* skip the + sign */
> +
> + if (src[source_index] == '-')
> + {
> + /* just a plus sign escaped as +- */
> + if (dry_run) dest_index++; else if (write_to_w_string(dst, dstlen, \
> &dest_index, '+')) return -1; + source_index++;
> + continue;
> + }
You are not checking properly for the source string length. Also please
add tests for such cases.
--
Alexandre Julliard
julliard@winehq.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic