Warn if p == NULL && max != 0. (#110087)

2003-04-07  Matthias Clasen  <maclas@gmx.de>

	* glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0.
	(#110087)
This commit is contained in:
Matthias Clasen 2003-04-06 22:16:59 +00:00 committed by Matthias Clasen
parent 8e0ff6907c
commit 048002c8f7
7 changed files with 33 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2003-04-07 Matthias Clasen <maclas@gmx.de>
* glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0.
(#110087)
2003-04-01 Tor Lillqvist <tml@iki.fi>
* glib/glib.def: Add g_string_chunk_insert_len.

View File

@ -1,3 +1,8 @@
2003-04-07 Matthias Clasen <maclas@gmx.de>
* glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0.
(#110087)
2003-04-01 Tor Lillqvist <tml@iki.fi>
* glib/glib.def: Add g_string_chunk_insert_len.

View File

@ -1,3 +1,8 @@
2003-04-07 Matthias Clasen <maclas@gmx.de>
* glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0.
(#110087)
2003-04-01 Tor Lillqvist <tml@iki.fi>
* glib/glib.def: Add g_string_chunk_insert_len.

View File

@ -1,3 +1,8 @@
2003-04-07 Matthias Clasen <maclas@gmx.de>
* glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0.
(#110087)
2003-04-01 Tor Lillqvist <tml@iki.fi>
* glib/glib.def: Add g_string_chunk_insert_len.

View File

@ -1,3 +1,8 @@
2003-04-07 Matthias Clasen <maclas@gmx.de>
* glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0.
(#110087)
2003-04-01 Tor Lillqvist <tml@iki.fi>
* glib/glib.def: Add g_string_chunk_insert_len.

View File

@ -1,3 +1,8 @@
2003-04-07 Matthias Clasen <maclas@gmx.de>
* glib/gutf8.c (g_utf8_strlen): Warn if p == NULL && max != 0.
(#110087)
2003-04-01 Tor Lillqvist <tml@iki.fi>
* glib/glib.def: Add g_string_chunk_insert_len.

View File

@ -202,7 +202,8 @@ g_utf8_prev_char (const gchar *p)
* @p: pointer to the start of a UTF-8 encoded string.
* @max: the maximum number of bytes to examine. If @max
* is less than 0, then the string is assumed to be
* nul-terminated.
* nul-terminated. If @max is 0, @p will not be examined and
* may be %NULL.
*
* Returns the length of the string in characters.
*
@ -214,6 +215,7 @@ g_utf8_strlen (const gchar *p,
{
glong len = 0;
const gchar *start = p;
g_return_val_if_fail (p != NULL || max == 0, 0);
if (max < 0)
{