Removes many of the warnings in valgrind with make check in corlib
2006-10-21 Miguel de Icaza <miguel@novell.com>
* src/gunicode.c (g_filename_from_utf8): Use g_strlcpy here.
* src/gmarkup.c (g_markup_parse_context_parse): Do not dereference
null values here. This gets things a little bit further in
corlib, but not too far.
svn path=/trunk/mono/; revision=66866
2006-10-21 Miguel de Icaza <miguel@novell.com>
+ * src/gunicode.c (g_filename_from_utf8): Use g_strlcpy here.
+
+ * src/gmarkup.c (g_markup_parse_context_parse): Do not dereference
+ null values here. This gets things a little bit further in
+ corlib, but not too far.
+
* src/gdir.c (g_dir_read_name): Do not return . or ..
* src/gstr.c (g_ascii_xdigit_value): Make this into a function,
return TRUE;
fail:
- if (context->parser.error && *error)
+ if (context->parser.error && error != NULL && *error)
context->parser.error (context, *error, context->user_data);
destroy_parse_state (context);
len = strlen (utf8string);
res = g_malloc (len + 1);
- strcpy (res, utf8string);
+ g_strlcpy (res, utf8string, len);
return res;
}