about summary refs log tree commit diff
path: root/stdlib/tst-qsort2.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@codesourcery.com>2014-06-20 21:29:33 +0100
committerMaciej W. Rozycki <macro@codesourcery.com>2014-06-20 21:29:33 +0100
commit4e6d234712f976eee62fb2047338a501da00c4c7 (patch)
tree2c2b3f7b58c824d5a20e5be5ddb5a349d262164a /stdlib/tst-qsort2.c
parent7fd00f998042e04038619ddd4ec78a4e114217b5 (diff)
downloadglibc-4e6d234712f976eee62fb2047338a501da00c4c7.tar.gz
glibc-4e6d234712f976eee62fb2047338a501da00c4c7.tar.xz
glibc-4e6d234712f976eee62fb2047338a501da00c4c7.zip
stdlib/tst-qsort2.c: Fix off-by-one argc interpretation error
This fixes an off-by-one argc interpretation error (argv[0] is included
in the count) in stdlib/tst-qsort2.c causing a segfault if the program
is called with one command-line argument only (argv[2] is NULL in that
case).
Diffstat (limited to 'stdlib/tst-qsort2.c')
-rw-r--r--stdlib/tst-qsort2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/tst-qsort2.c b/stdlib/tst-qsort2.c
index 75d4a1732d..10d16852b0 100644
--- a/stdlib/tst-qsort2.c
+++ b/stdlib/tst-qsort2.c
@@ -70,7 +70,7 @@ int
 main (int argc, char **argv)
 {
   int ret = 0;
-  if (argc >= 2)
+  if (argc >= 3)
     ret |= test (atoi (argv[1]), atoi (argv[2]));
   else
     {