2007-12-06 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/json/json-parser.[ch]: Use gssize, size we allow -1
	as a length (meaning "use the whole string").

	(json_parser_load_from_data): Use the passed length instead of
	using strlen() all the time.

	* clutter/clutter-script.[ch]: Ditto as above.
This commit is contained in:
Emmanuele Bassi
2007-12-06 11:25:16 +00:00
parent 6e25c4ef96
commit 6fae4bcfc9
5 changed files with 18 additions and 5 deletions

View File

@ -888,7 +888,7 @@ json_parser_load_from_file (JsonParser *parser,
gboolean
json_parser_load_from_data (JsonParser *parser,
const gchar *data,
gsize length,
gssize length,
GError **error)
{
GScanner *scanner;
@ -909,7 +909,7 @@ json_parser_load_from_data (JsonParser *parser,
}
scanner = json_scanner_new (parser);
g_scanner_input_text (scanner, data, strlen (data));
g_scanner_input_text (scanner, data, length);
for (i = 0; i < n_symbols; i++)
{