mirror of https://github.com/eclipse/paho.mqtt.c
Merge branch 'master' into develop
This commit is contained in:
commit
cae0e4e8df
12
src/utf-8.c
12
src/utf-8.c
|
|
@ -3,11 +3,11 @@
|
|||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
* and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||
*
|
||||
* The Eclipse Public License is available at
|
||||
* The Eclipse Public License is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
* and the Eclipse Distribution License is available at
|
||||
* and the Eclipse Distribution License is available at
|
||||
* http://www.eclipse.org/org/documents/edl-v10.php.
|
||||
*
|
||||
* Contributors:
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
*
|
||||
* See page 104 of the Unicode Standard 5.0 for the list of well formed
|
||||
* UTF-8 byte sequences.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#include "utf-8.h"
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ struct
|
|||
char upper; /**< upper limit of valid range */
|
||||
} bytes[4]; /**< up to 4 bytes can be used per character */
|
||||
}
|
||||
valid_ranges[] =
|
||||
valid_ranges[] =
|
||||
{
|
||||
{1, { {00, 0x7F} } },
|
||||
{2, { {0xC2, 0xDF}, {0x80, 0xBF} } },
|
||||
|
|
@ -136,7 +136,7 @@ int UTF8_validate(int len, const char* data)
|
|||
}
|
||||
curdata = UTF8_char_validate(len, data);
|
||||
while (curdata && (curdata < data + len))
|
||||
curdata = UTF8_char_validate(data + len - curdata, curdata);
|
||||
curdata = UTF8_char_validate((int)(data + len - curdata), curdata);
|
||||
|
||||
rc = curdata != NULL;
|
||||
exit:
|
||||
|
|
|
|||
Loading…
Reference in New Issue