summaryrefslogtreecommitdiff
path: root/src/sexp.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2001-08-28 09:04:30 +0000
committerWerner Koch <wk@gnupg.org>2001-08-28 09:04:30 +0000
commit5d31d90056436511a6a63b9eee61ce866d66bf74 (patch)
tree9945db084823e034d7953c89a6acd9613d165c69 /src/sexp.c
parent33e1c85bc0b0b5c45e88fcd9d7570eb0a0dd3b44 (diff)
downloadlibgcrypt-5d31d90056436511a6a63b9eee61ce866d66bf74.tar.gz
Fixed va_list problem
Diffstat (limited to 'src/sexp.c')
-rw-r--r--src/sexp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/sexp.c b/src/sexp.c
index 7db238c7..eaf62a33 100644
--- a/src/sexp.c
+++ b/src/sexp.c
@@ -661,7 +661,7 @@ make_space ( struct make_space_ctx *c, size_t n )
* Scan the provided buffer and return the S expression in our internal
* format. Returns a newly allocated expression. If erroff is not NULL and
* a parsing error has occured, the offset into buffer will be returned.
- * If ARG_PTR is not NULL, the function supports some printf like
+ * If ARGFLAG is true, the function supports some printf like
* expressions.
* These are:
* %m - MPI
@@ -679,7 +679,7 @@ make_space ( struct make_space_ctx *c, size_t n )
*/
static int
sexp_sscan( GCRY_SEXP *retsexp, size_t *erroff ,
- const char *buffer, size_t length, va_list arg_ptr )
+ const char *buffer, size_t length, va_list arg_ptr, int argflag )
{
static const char tokenchars[] = "abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
@@ -972,7 +972,7 @@ sexp_sscan( GCRY_SEXP *retsexp, size_t *erroff ,
*erroff = p - buffer;
return -10; /* unexpected reserved punctuation */
}
- else if( arg_ptr && *p == '%' ) {
+ else if( argflag && *p == '%' ) {
percent = p;
}
else { /* bad or unavailable*/
@@ -994,7 +994,9 @@ int
gcry_sexp_sscan( GCRY_SEXP *retsexp, size_t *erroff,
const char *buffer, size_t length )
{
- return sexp_sscan( retsexp, erroff, buffer, length, NULL );
+ va_list dummy_arg_ptr = 0;
+
+ return sexp_sscan( retsexp, erroff, buffer, length, dummy_arg_ptr, 0 );
}
int
@@ -1004,7 +1006,7 @@ gcry_sexp_build( GCRY_SEXP *retsexp, size_t *erroff, const char *format, ... )
va_list arg_ptr ;
va_start( arg_ptr, format ) ;
- rc = sexp_sscan( retsexp, erroff, format, strlen(format), arg_ptr );
+ rc = sexp_sscan( retsexp, erroff, format, strlen(format), arg_ptr, 1 );
va_end(arg_ptr);
return rc;