[glib] tests: Fix GSList test to not dereference off the end of an array
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] tests: Fix GSList test to not dereference off the end of an array
- Date: Sat, 13 Aug 2016 08:39:15 +0000 (UTC)
commit f1eeb7cf8c14b30e6267ed6aa663c0f617f55693
Author: Philip Withnall <philip withnall collabora co uk>
Date: Sat Aug 13 10:29:31 2016 +0200
tests: Fix GSList test to not dereference off the end of an array
This looks like a typo or copypasta error. As spotted by cppcheck, which
is the code analysis tool GLib deserves, but not the one it needs right
now.
glib/tests/slist.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/glib/tests/slist.c b/glib/tests/slist.c
index 482d76a..f1a8495 100644
--- a/glib/tests/slist.c
+++ b/glib/tests/slist.c
@@ -204,7 +204,7 @@ test_slist_remove_all (void)
g_assert_cmpint (g_slist_length (slist), ==, 20);
- for (i = 0; i < 10; i++)
+ for (i = 0; i < 5; i++)
{
slist = g_slist_remove_all (slist, &nums[2 * i + 1]);
slist = g_slist_remove_all (slist, &nums[8 - 2 * i]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]