Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!agate!darkstar!cats.ucsc.edu!jik From: jik@cats.ucsc.edu (Jonathan I. Kamens) Newsgroups: comp.unix.questions Subject: Re: errno Message-ID: <17138@darkstar.ucsc.edu> Date: 17 Jun 91 21:16:59 GMT References: <1991Jun15.151924.24619@thunder.mcrcim.mcgill.edu> <2157@mitisft.Convergent.COM> Sender: usenet@darkstar.ucsc.edu Organization: University of California, Santa Cruz Lines: 10 In article <2157@mitisft.Convergent.COM>, dold@mitisft.Convergent.COM (Clarence Dold) writes: |> printf("Errno %d: %s\n", want_err, |> want_err <= sys_nerr ? sys_errlist[want_err] : "Out of range" ); The "<=" should be "<". Sys_nerr records the number of elements in the sys_errlist array, which means the highest valid index in the array is sys_nerr-1, and the lowest is 0. -- Jonathan Kamens jik@CATS.UCSC.EDU