diff options
author | Roland McGrath <roland@gnu.org> | 1992-09-23 20:32:45 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1992-09-23 20:32:45 +0000 |
commit | 01d8cfe4db30f0d64a5b0a997d863da40b6f20e4 (patch) | |
tree | b8334a354a234a78267fcde3438173900cebb36e /stdlib | |
parent | bb50c3d4092ab663070710b693d62cdcc301473a (diff) |
entered into RCS
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/qsort.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stdlib/qsort.c b/stdlib/qsort.c index 93dd3ec786..bc8d171b79 100644 --- a/stdlib/qsort.c +++ b/stdlib/qsort.c @@ -88,6 +88,10 @@ DEFUN(_quicksort, (pbase, total_elems, size, cmp), char *pivot_buffer = (char *) __alloca (size); CONST size_t max_thresh = MAX_THRESH * size; + if (total_elems == 0) + /* Avoid lossage with unsigned arithmetic below. */ + return; + if (total_elems > MAX_THRESH) { char *lo = base_ptr; |