From: Marcus Brinkmann Date: Sat, 28 Sep 2002 20:08:01 +0000 (+0000) Subject: 2002-09-28 Marcus Brinkmann X-Git-Tag: gpgme-1.2.0@1385~807 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a7179d82e40f3f2e92f7f643f4e5db989d5cfe88;p=gpgme.git 2002-09-28 Marcus Brinkmann * conversion.c (_gpgme_hextobyte): Prevent superfluous multiplication with base. Reported by St�phane Corth�sy. * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous operation type in invocation of _gpgme_op_reset. --- diff --git a/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 325a064..a2cd246 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/gpgme/ChangeLog @@ -1,3 +1,11 @@ +2002-09-28 Marcus Brinkmann + + * conversion.c (_gpgme_hextobyte): Prevent superfluous + multiplication with base. Reported by Stéphane Corthésy. + + * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous + operation type in invocation of _gpgme_op_reset. + 2002-09-20 Werner Koch * ath.c: Include sys/time.h if sys/select.h is not available. diff --git a/trunk/gpgme/conversion.c b/trunk/gpgme/conversion.c index 8302f99..ad85a8a 100644 --- a/trunk/gpgme/conversion.c +++ b/trunk/gpgme/conversion.c @@ -23,6 +23,7 @@ #include #endif +#include #include #include "gpgme.h" #include "util.h" @@ -34,7 +35,8 @@ _gpgme_hextobyte (const byte *str) int val = 0; int i; - for (i = 0; i < 2; i++) +#define NROFHEXDIGITS 2 + for (i = 0; i < NROFHEXDIGITS; i++) { if (*str >= '0' && *str <= '9') val += *str - '0'; @@ -44,7 +46,8 @@ _gpgme_hextobyte (const byte *str) val += 10 + *str - 'a'; else return -1; - val *= 16; + if (i < NROFHEXDIGITS - 1) + val *= 16; str++; } return val; diff --git a/trunk/gpgme/keylist.c b/trunk/gpgme/keylist.c index 6ae9b1e..044fb75 100644 --- a/trunk/gpgme/keylist.c +++ b/trunk/gpgme/keylist.c @@ -633,9 +633,7 @@ gpgme_op_keylist_ext_start (GpgmeCtx ctx, const char *pattern[], { GpgmeError err = 0; - /* Keylist operations are always "synchronous" in the sense that we - don't add ourself to the global FD table. */ - err = _gpgme_op_reset (ctx, 1); + err = _gpgme_op_reset (ctx, 2); if (err) goto leave;