1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

agent: Replace most assert by log_assert.

--
This commit is contained in:
Werner Koch 2019-05-14 10:31:46 +02:00
parent 5651b2c460
commit 54e96c6fd2
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
17 changed files with 42 additions and 60 deletions

View file

@ -25,7 +25,6 @@
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef HAVE_LOCALE_H
@ -198,10 +197,10 @@ make_canonical (const char *fname, const char *buf, size_t buflen)
return NULL;
}
len = gcry_sexp_sprint (sexp, GCRYSEXP_FMT_CANON, NULL, 0);
assert (len);
log_assert (len);
result = xmalloc (len);
len = gcry_sexp_sprint (sexp, GCRYSEXP_FMT_CANON, result, len);
assert (len);
log_assert (len);
gcry_sexp_release (sexp);
return result;
}
@ -222,10 +221,10 @@ make_advanced (const unsigned char *buf, size_t buflen)
return NULL;
}
len = gcry_sexp_sprint (sexp, GCRYSEXP_FMT_ADVANCED, NULL, 0);
assert (len);
log_assert (len);
result = xmalloc (len);
len = gcry_sexp_sprint (sexp, GCRYSEXP_FMT_ADVANCED, result, len);
assert (len);
log_assert (len);
gcry_sexp_release (sexp);
return result;
}
@ -433,7 +432,7 @@ read_and_shadow (const char *fname)
return;
}
resultlen = gcry_sexp_canon_len (result, 0, NULL,NULL);
assert (resultlen);
log_assert (resultlen);
if (opt_armor)
{
@ -469,7 +468,7 @@ show_shadow_info (const char *fname)
return;
}
infolen = gcry_sexp_canon_len (info, 0, NULL,NULL);
assert (infolen);
log_assert (infolen);
if (opt_armor)
{
@ -496,7 +495,7 @@ show_file (const char *fname)
return;
keylen = gcry_sexp_canon_len (key, 0, NULL,NULL);
assert (keylen);
log_assert (keylen);
if (opt_canonical)
{
@ -723,7 +722,7 @@ get_passphrase (int promptno)
gpg_strerror (err));
agent_exit (0);
}
assert (pw);
log_assert (pw);
return pw;
}