From 1d8251c3f2f362ef94939992519f376b0640b1bc Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Tue, 6 Nov 2007 10:18:17 +0000 Subject: [PATCH] Better error messages. --- lib/silcapputil/silcapputil.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/silcapputil/silcapputil.c b/lib/silcapputil/silcapputil.c index abd82dc3..157cce57 100644 --- a/lib/silcapputil/silcapputil.c +++ b/lib/silcapputil/silcapputil.c @@ -31,13 +31,17 @@ static char *silc_create_pk_identifier(void) /* Get hostname */ hostname = silc_net_localhost(); - if (!hostname) + if (!hostname) { + fprintf(stderr, "Could not resolve local hostname/IP address"); return NULL; + } /* Get username (mandatory) */ username = silc_get_username(); - if (!username) + if (!username) { + fprintf(stderr, "Could not determine username"); return NULL; + } /* Create default email address, whether it is right or not */ silc_snprintf(email, sizeof(email), "%s@%s", username, hostname); @@ -136,8 +140,7 @@ New pair of keys will be created. Please, answer to following questions.\n\ } } else { if (!def) { - fprintf(stderr, "Could not create public key identifier: %s\n", - strerror(errno)); + fprintf(stderr, "Could not create public key identifier\n"); return FALSE; } identifier = strdup(def); -- 2.24.0