rh

Check-in [9802a7a9b5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Get rid of deprecated sys_nerr/sys_errlist
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:9802a7a9b5dcc1ae86996d250baab13c2c0cbcc0b953d53d4a27f07a7bbc288c
User & Date: ajv-899-334-8894@vsta.org 2010-04-22 03:02:46
Context
2010-04-22
03:03
Add access to allocated blocks, so I can find files with allocation holes check-in: 6827c7f100 user: ajv-899-334-8894@vsta.org tags: master, trunk
03:02
Get rid of deprecated sys_nerr/sys_errlist check-in: 9802a7a9b5 user: ajv-899-334-8894@vsta.org tags: master, trunk
2009-11-23
04:04
Tighten up code. Treat embedded spaces in filenames as a graphic char; don't map it into '?'. check-in: 8e4aa40c5f user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to errmsg.c.

     8      8    *
     9      9    * Global Functions: error, warning
    10     10    *
    11     11    * Static Functions: percent_m, errmsg
    12     12    */
    13     13   
    14     14   #if !defined(lint)
    15         -static char rcsid[] = "$Id: errmsg.c,v 1.2 1994/01/26 16:18:48 rick Exp $";
           15  +static char rcsid[] = "$Id: errmsg.c,v 1.1 2008/12/27 00:56:03 vandys Exp vandys $";
    16     16   #endif
    17     17   
    18     18   #include <stdio.h>
    19     19   #include <stdlib.h>
    20     20   #include <stdarg.h>
    21     21   #include <string.h>
    22     22   
................................................................................
    67     67   
    68     68   
    69     69       (void) fprintf(stderr, "%s: ", Program_name);
    70     70       
    71     71       if ((m_ptr = percent_m(format)) != NULL) {
    72     72   	(void) strncpy(new_format, format, m_ptr - format);
    73     73   	nfp = new_format + (m_ptr - format);
    74         -	if (save_errno < sys_nerr) {
    75         -	    for (p = sys_errlist[save_errno]; *p != '\0'; *nfp++ = *p++) {
    76         -		;	/* empty loop */
           74  +	p = strerror(save_errno);
           75  +	if (p) {
           76  +	    while (*p) {
           77  +		*nfp++ = *p++;
    77     78   	    }
    78         -	}
    79         -	else {
           79  +	} else {
    80     80   	    (void) sprintf(nfp, "Unknown error : %d", save_errno);
    81     81   	    nfp += strlen(nfp);
    82     82   	}
    83     83   	(void) strcpy(nfp, m_ptr + 2);
    84     84   	format = new_format;
    85     85       }
    86     86