Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!swrinde!ucsd!ucbvax!hplabs!otter.hpl.hp.com!hpltoad!cdollin!kers From: kers@hplb.hpl.hp.com (Chris Dollin) Newsgroups: comp.std.c Subject: bsearch of empty array Message-ID: Date: 15 May 91 14:49:37 GMT Sender: news@hplb.hpl.hp.com (Usenet News Administrator) Distribution: comp Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 13 Nntp-Posting-Host: cdollin.hpl.hp.com If bsearch is called with $nmemb == 0$, is $base$ required to point to a legitimate array, or can it be $NULL$ ? [A library I know of hangs in this case; I'd like to know if my code is broken, or if the library is.] A similar question arises for $qsort$; if one $qsort$'s 0 elements, is the value of the array pointer required to point to a proper array, or is it allowed to be $NULL$? -- Kers. | "A foolish hobgoblin has the consistency of little minds".