From: Fabian Keil Date: Sun, 22 May 2011 10:26:45 +0000 (+0000) Subject: Garbage collect safe_strerror() which isn't used anywhere X-Git-Tag: v_3_0_18~227 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=7600ab8fcf587195f51d2faf6e92d1d1a2e24fd0 Garbage collect safe_strerror() which isn't used anywhere --- diff --git a/miscutil.c b/miscutil.c index 63ffca6a..421f2b5c 100644 --- a/miscutil.c +++ b/miscutil.c @@ -1,16 +1,15 @@ -const char miscutil_rcs[] = "$Id: miscutil.c,v 1.64 2009/05/19 17:45:31 fabiankeil Exp $"; +const char miscutil_rcs[] = "$Id: miscutil.c,v 1.65 2011/04/19 13:00:47 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $ * - * Purpose : zalloc, hash_string, safe_strerror, strcmpic, - * strncmpic, chomp, and MinGW32 strdup - * functions. - * These are each too small to deserve their own file - * but don't really fit in any other file. + * Purpose : zalloc, hash_string, strcmpic, strncmpic, and + * MinGW32 strdup functions. These are each too small + * to deserve their own file but don't really fit in + * any other file. * - * Copyright : Written by and Copyright (C) 2001-2007 - * the SourceForge Privoxy team. http://www.privoxy.org/ + * Copyright : Written by and Copyright (C) 2001-2011 the + * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written * by and Copyright (C) 1997 Anonymous Coders and @@ -191,44 +190,6 @@ char *strdup( const char *s ) #endif /* def __MINGW32__ */ - -/********************************************************************* - * - * Function : safe_strerror - * - * Description : Variant of the library routine strerror() which will - * work on systems without the library routine, and - * which should never return NULL. - * - * Parameters : - * 1 : err = the `errno' of the last operation. - * - * Returns : An "English" string of the last `errno'. Allocated - * with strdup(), so caller frees. May be NULL if the - * system is out of memory. - * - *********************************************************************/ -char *safe_strerror(int err) -{ - char *s = NULL; - char buf[BUFFER_SIZE]; - - -#ifdef HAVE_STRERROR - s = strerror(err); -#endif /* HAVE_STRERROR */ - - if (s == NULL) - { - snprintf(buf, sizeof(buf), "(errno = %d)", err); - s = buf; - } - - return(strdup(s)); - -} - - /********************************************************************* * * Function : strcmpic diff --git a/miscutil.h b/miscutil.h index eff5cb3d..4fbc5092 100644 --- a/miscutil.h +++ b/miscutil.h @@ -1,16 +1,16 @@ #ifndef MISCUTIL_H_INCLUDED #define MISCUTIL_H_INCLUDED -#define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.30 2008/04/17 14:53:31 fabiankeil Exp $" +#define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.31 2009/05/16 13:27:20 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/miscutil.h,v $ * - * Purpose : zalloc, hash_string, safe_strerror, strcmpic, - * strncmpic, and MinGW32 strdup functions. These are - * each too small to deserve their own file but don't - * really fit in any other file. + * Purpose : zalloc, hash_string, strcmpic, strncmpic, and + * MinGW32 strdup functions. These are each too small + * to deserve their own file but don't really fit in + * any other file. * - * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge + * Copyright : Written by and Copyright (C) 2001-2011 the * Privoxy team. http://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -53,8 +53,6 @@ extern void write_pid_file(void); extern unsigned int hash_string(const char* s); -extern char *safe_strerror(int err); - extern int strcmpic(const char *s1, const char *s2); extern int strncmpic(const char *s1, const char *s2, size_t n);