Use memcpy instead of strcpy. (#106988, Christian Biere)

2003-05-27  Matthias Clasen  <maclas@gmx.de>

	* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
	strcpy. (#106988, Christian Biere)
This commit is contained in:
Matthias Clasen 2003-05-27 21:30:08 +00:00 committed by Matthias Clasen
parent 8d52393e7e
commit c868c58694
7 changed files with 34 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-23 Noah Levitt <nlevitt@columbia.edu>
* glib/gutf8.c: Fix typo in UNICODE_VALID (related to #107427).

View File

@ -1,3 +1,8 @@
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-23 Noah Levitt <nlevitt@columbia.edu>
* glib/gutf8.c: Fix typo in UNICODE_VALID (related to #107427).

View File

@ -1,3 +1,8 @@
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-23 Noah Levitt <nlevitt@columbia.edu>
* glib/gutf8.c: Fix typo in UNICODE_VALID (related to #107427).

View File

@ -1,3 +1,8 @@
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-23 Noah Levitt <nlevitt@columbia.edu>
* glib/gutf8.c: Fix typo in UNICODE_VALID (related to #107427).

View File

@ -1,3 +1,8 @@
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-23 Noah Levitt <nlevitt@columbia.edu>
* glib/gutf8.c: Fix typo in UNICODE_VALID (related to #107427).

View File

@ -1,3 +1,8 @@
2003-05-27 Matthias Clasen <maclas@gmx.de>
* glib/gstrfuncs.c (g_strdup): Use memcpy instead of
strcpy. (#106988, Christian Biere)
2003-05-23 Noah Levitt <nlevitt@columbia.edu>
* glib/gutf8.c: Fix typo in UNICODE_VALID (related to #107427).

View File

@ -83,11 +83,13 @@ gchar*
g_strdup (const gchar *str)
{
gchar *new_str;
gsize length;
if (str)
{
new_str = g_new (char, strlen (str) + 1);
strcpy (new_str, str);
length = strlen (str) + 1;
new_str = g_new (char, length);
memcpy (new_str, str, length);
}
else
new_str = NULL;