diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2001-12-12 22:05:55 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2001-12-12 22:05:55 +0000 |
commit | a99e75d0a8345b21c4132ece9b3510a38ae30e1d (patch) | |
tree | 6c4c06cbf9362dd1a7f4a12a9a2a3542829e1225 /tests | |
parent | 3fa33317b7e9866793ce1ea32d069e8c9270caa2 (diff) | |
download | glib-a99e75d0a8345b21c4132ece9b3510a38ae30e1d.tar.gz glib-a99e75d0a8345b21c4132ece9b3510a38ae30e1d.tar.bz2 glib-a99e75d0a8345b21c4132ece9b3510a38ae30e1d.zip |
This fixes #60543:
* glib/gutils.c (g_snprintf, g_vsnprintf): Switch to C99-[v]snprintf().
* tests/strfunc-test.c: Add some tests for g_snprintf().
Diffstat (limited to 'tests')
-rw-r--r-- | tests/strfunc-test.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/strfunc-test.c b/tests/strfunc-test.c index 0c7b5c215..73eb86a8a 100644 --- a/tests/strfunc-test.c +++ b/tests/strfunc-test.c @@ -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; } |