Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!milton!sumax!polari!kentfo From: kentfo@polari.UUCP (Kent Forschmiedt) Newsgroups: comp.sources.d Subject: Re: v01INF1: Status - Status of comp.sources.reviewed Message-ID: <3840@polari.UUCP> Date: 23 Apr 91 16:34:08 GMT References: <6_WAABB@xds13.ferranti.com> Organization: Seattle Online Public Unix (206) 328-4944 Lines: 27 In article meissner@osf.org (Michael Meissner) writes: > This can produce the wrong error message if sprintf sets errno (for > example if it calls malloc and malloc fails). In article <6_WAABB@xds13.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes: > >I don't know of any implementations where sprintf can set errno. >Does *anyone* know of one? Who cares? If there is one, or somebody someday makes one, somebody will eventually be bitten. Many years ago, I began adding two lines of code to my versions of these functions, and stopped losing sleep. errorthing(char *whatever) { char buf[200]; int etmp = errno; /* whatever */ errno = etmp; perror(buf); } -- Kent Forschmiedt ... kentfo@polari ... uw-beaver!sumax!polari!kentfo