diff options
author | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-06-28 09:00:11 +0000 |
---|---|---|
committer | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-06-28 09:00:11 +0000 |
commit | bd2648f6d0023b72d8d60eb331c0adede849a6c9 (patch) | |
tree | a97bda6f59cab16eea09e6e4caf2781785378177 /wsutil | |
parent | 7482c4230f17249aab6a65c73184549b017c06ac (diff) |
Replace all strerror() with g_strerror().
Remove our local strerror implementation.
Mark strerror as locale unsafe API.
This fixes bug 5715.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37812 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/CMakeLists.txt | 1 | ||||
-rw-r--r-- | wsutil/Makefile.am | 8 | ||||
-rw-r--r-- | wsutil/strerror.c | 43 | ||||
-rw-r--r-- | wsutil/strerror.h | 33 |
4 files changed, 0 insertions, 85 deletions
diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt index 7e6d80f8fa..25eabb1d64 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt @@ -33,7 +33,6 @@ set(WSUTIL_FILES # @INET_ATON_LO@ # inet_aton.c # @INET_NTOP_LO@ # inet_ntop.c # @INET_PTON_LO@ # inet_pton.c -# @STRERROR_LO@ # strerror.c # @STRNCASECMP_LO@ # strncasecmp.c # @STRPTIME_LO@ # strptime.c mpeg-audio.c diff --git a/wsutil/Makefile.am b/wsutil/Makefile.am index 82a88aa655..8688c7376c 100644 --- a/wsutil/Makefile.am +++ b/wsutil/Makefile.am @@ -54,12 +54,6 @@ else def_sym_filter_symbols += || /^ws_inet_pton/ endif -if NEED_STRERROR_LO -wsutil_optional_objects += @STRERROR_LO@ -else -def_sym_filter_symbols += || /^strerror/ -endif - if NEED_STRNCASECMP_LO wsutil_optional_objects += @STRNCASECMP_LO@ else @@ -98,8 +92,6 @@ EXTRA_libwsutil_la_SOURCES= \ inet_ntop.c \ inet_pton.c \ inet_v6defs.h \ - strerror.c \ - strerror.h \ strncasecmp.c \ strptime.c \ strptime.h \ diff --git a/wsutil/strerror.c b/wsutil/strerror.c deleted file mode 100644 index 81e66e5e34..0000000000 --- a/wsutil/strerror.c +++ /dev/null @@ -1,43 +0,0 @@ -/* strerror.c - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs <gerald@wireshark.org> - * Copyright 1998 Gerald Combs - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "strerror.h" -#include <glib.h> - -/* - * Version of "strerror()", for the benefit of OSes that don't have it - * (e.g., SunOS 4.x). - */ -char * -strerror(int errnum) -{ - extern int sys_nerr; - extern char *sys_errlist[]; - static char errbuf[5+1+11+1]; /* "Error %d" */ - - if (errnum < 0 || errnum >= sys_nerr) { - g_snprintf(errbuf, 18, "Error %d", errnum); - return errbuf; - } else - return sys_errlist[errnum]; -} diff --git a/wsutil/strerror.h b/wsutil/strerror.h deleted file mode 100644 index 423655bbcc..0000000000 --- a/wsutil/strerror.h +++ /dev/null @@ -1,33 +0,0 @@ -/* strerror.h - * - * $Id$ - * - * Wireshark - Network traffic analyzer - * By Gerald Combs <gerald@wireshark.org> - * Copyright 1998 Gerald Combs - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __STRERROR_H__ -#define __STRERROR_H__ - -/* - * Version of "strerror()", for the benefit of OSes that don't have it - * (e.g., SunOS 4.x). - */ -extern char *strerror(int); - -#endif |