Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <69E2FE062AA0D411BE9B00306E00E15222F666@NL-GRH-MAIL01> From: Arjen Bax To: cygwin AT cygwin DOT com Subject: RE: tcp_wrappers Date: Tue, 27 Mar 2001 16:42:28 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Aloha, Jacek Trzcinski [mailto:jacek AT certum DOT pl] wrote on Tuesday, March 27, 2001 3:53 PM: > I had to change to: > > if (errno < _sys_nerr && errno > 0) > { > strcpy(bp, _sys_errlist[errno]); > } else > { > sprintf(bp, "Unknown error %d", errno); > } > Does anybody know it can be made simpler ( with minimal changes). It > seems to be typical names problem. This changes I made looking at > libcygwin.a and watching what are correct names of needed variables. This looks exactly like the implementation of the standard function strerror() to me, so it could be replaced by: #include strcpy(bp, strerror(errno)); Of course, look out for overflow of your buffer bp[], but you already knew that ;-). HTH, Arjen Bax -- CMG Noord-Nederland B.V. Sector Telecommunications & Utilities Postbus 70237, 9704 AE Groningen Tel. (050)52 19 500, Fax (050)52 19 504 Adding manpower to a late software project makes it later. -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple