aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-11-13 16:43:23 +0000
committerWerner Koch <[email protected]>1999-11-13 16:43:23 +0000
commit881e51323749ba797202d8a4119910e6f9d2f727 (patch)
tree3de535d07143b9b3513b524dd81f32a5305756b1 /util
parentSee ChangeLog: Thu Oct 28 16:17:46 CEST 1999 Werner Koch (diff)
downloadgnupg-881e51323749ba797202d8a4119910e6f9d2f727.tar.gz
gnupg-881e51323749ba797202d8a4119910e6f9d2f727.zip
See ChangeLog: Sat Nov 13 17:44:23 CET 1999 Werner Koch
Diffstat (limited to 'util')
-rw-r--r--util/ChangeLog6
-rw-r--r--util/Makefile.am2
-rw-r--r--util/errors.c9
-rw-r--r--util/g10u.c40
4 files changed, 15 insertions, 42 deletions
diff --git a/util/ChangeLog b/util/ChangeLog
index 84fd83c62..ff2e09e38 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -1,3 +1,9 @@
+Sat Nov 13 17:44:23 CET 1999 Werner Koch <[email protected]>
+
+ * g10u.c: Removed.
+
+ * errors.c (g10_errstr): Use gcry_strerror as fallback
+
Tue Oct 26 14:10:21 CEST 1999 Werner Koch <[email protected]>
* simple-gettext.c (set_gettext_file): Check charset and do
diff --git a/util/Makefile.am b/util/Makefile.am
index 95096c7e7..c695db586 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -6,7 +6,7 @@ noinst_LTLIBRARIES = libutil.la
libutil_la_LDFLAGS =
-libutil_la_SOURCES = g10u.c logger.c fileutil.c miscutil.c strgutil.c \
+libutil_la_SOURCES = logger.c fileutil.c miscutil.c strgutil.c \
ttyio.c argparse.c memory.c secmem.c errors.c iobuf.c \
dotlock.c http.c simple-gettext.c
diff --git a/util/errors.c b/util/errors.c
index 0590f8ed8..d92892c12 100644
--- a/util/errors.c
+++ b/util/errors.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <stdarg.h>
+#include <gcrypt.h>
#include "errors.h"
#include "i18n.h"
@@ -100,7 +101,13 @@ g10_errstr( int err )
X(NETWORK ,N_("network error"))
X(SELFTEST_FAILED,"selftest failed")
X(NOT_ENCRYPTED ,N_("not encrypted"))
- default: p = buf; sprintf(buf, "g10err=%d", err); break;
+ default: /* pass on to libgcrypt */
+ if( err >= 0 ) /* pass on to libgcrypt */
+ p = gcry_strerror(err); /* fimxe: how do we handle i18n? */
+ else {
+ p = buf; sprintf(buf, "g10err=%d", err); break;
+ }
+ break;
}
#undef X
return _(p);
diff --git a/util/g10u.c b/util/g10u.c
deleted file mode 100644
index 2ce3a4e36..000000000
--- a/util/g10u.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* g10u.c - Wrapper for utility functions
- * Copyright (C) 1998 Free Software Foundation, Inc.
- *
- * This file is part of GnuPG.
- *
- * GnuPG 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.
- *
- * GnuPG 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 <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "mpi.h"
-#include "util.h"
-
-
-/* FIXME: The modules should use functions from libgcrypt */
-
-const char *g10u_revision_string(int dummy) { return "$Revision$"; }
-
-
-void *g10_malloc( size_t n ) { return m_alloc( n ); }
-void *g10_calloc( size_t n ) { return m_alloc_clear( n ); }
-void *g10_malloc_secure( size_t n ) { return m_alloc_secure( n ); }
-void *g10_calloc_secure( size_t n ) { return m_alloc_secure_clear( n ); }
-void *g10_realloc( void *a, size_t n ) { return m_realloc( a, n ); }
-void g10_free( void *p ) { m_free( p ); }
-char *g10_strdup( const char * a) { return m_strdup( a ); }
-