Makes make check in corlib progress a little bit.
authorMiguel de Icaza <miguel@gnome.org>
Sun, 22 Oct 2006 00:26:34 +0000 (00:26 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Sun, 22 Oct 2006 00:26:34 +0000 (00:26 -0000)
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

eglib/ChangeLog
eglib/src/gmarkup.c
eglib/src/gunicode.c

index 5839268e0a6802844cb210cd922b691a888f91ba..71bb3890f1c45f1eeb1680e719d2f21ed50b392a 100644 (file)
@@ -1,5 +1,11 @@
 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,
index 7214885b574b19a79d00b778ce0d8157cb90f202..6f342abd922a6efeae0e57893de0900d00e239c6 100644 (file)
@@ -425,7 +425,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context,
 
        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);
index 3833ba738e5cff85e3d606c4a0bf09717aad822e..8692dd1fb05c4906108214ad231507ed63215411 100644 (file)
@@ -140,7 +140,7 @@ g_filename_from_utf8 (const gchar *utf8string, gssize len, gsize *bytes_read, gs
                len = strlen (utf8string);
 
        res = g_malloc (len + 1);
-       strcpy (res, utf8string);
+       g_strlcpy (res, utf8string, len);
        return res;
 }