* glib/gutils.c (g_snprintf, g_vsnprintf): Switch to C99-[v]snprintf().

        * tests/strfunc-test.c: Add some tests for g_snprintf().
This commit is contained in:
Matthias Clasen
2001-12-12 22:05:55 +00:00
parent 3fa33317b7
commit a99e75d0a8
12 changed files with 123 additions and 60 deletions

View File

@@ -383,5 +383,15 @@ main (int argc,
#undef S
{
gchar buf[5];
TEST (NULL, 3 == g_snprintf (buf, 0, "%s", "abc"));
TEST (NULL, 3 == g_snprintf (NULL,0, "%s", "abc"));
TEST (NULL, 3 == g_snprintf (buf, 5, "%s", "abc"));
TEST (NULL, 4 == g_snprintf (buf, 5, "%s", "abcd"));
TEST (NULL, 9 == g_snprintf (buf, 5, "%s", "abcdefghi"));
}
return any_failed;
}