/[winpt]/trunk/Src/wptKeyEditCB.cpp
ViewVC logotype

Diff of /trunk/Src/wptKeyEditCB.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 277 by twoaday, Fri Dec 8 10:22:17 2006 UTC revision 278 by twoaday, Mon Jan 15 22:02:04 2007 UTC
# Line 13  Line 13 
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * General Public License for more details.   * General Public License for more details.
  *  
  * You should have received a copy of the GNU General Public License  
  * along with WinPT; if not, write to the Free Software Foundation,  
  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  
16   */   */
   
17  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
18  #include <config.h>  #include <config.h>
19  #endif  #endif
# Line 34  Line 29 
29  #include "wptContext.h"  #include "wptContext.h"
30  #include "wptKeyEdit.h"  #include "wptKeyEdit.h"
31  #include "wptErrors.h"  #include "wptErrors.h"
32    #include "wptTypes.h"
33    
34    
35  /* Possible errors for the edit key operation. */  /* Possible errors for the edit key operation. */
36  enum editkey_error_t {  enum editkey_error_t {
# Line 54  cmd_notation_handler (GpgKeyEdit *ctx, s Line 51  cmd_notation_handler (GpgKeyEdit *ctx, s
51          int uid = ctx->getUseridIndex ();          int uid = ctx->getUseridIndex ();
52          ctx->cmd_sent = 1;          ctx->cmd_sent = 1;
53          if (uid != -1) {          if (uid != -1) {
54              sprintf (buf, "uid %d", ctx->getUseridIndex ());              _snprintf (buf, DIM (buf)-1, "uid %d", ctx->getUseridIndex ());
55              return buf;              return buf;
56          }          }
57      }      }
# Line 81  cmd_keyserv_handler (GpgKeyEdit *ctx, gp Line 78  cmd_keyserv_handler (GpgKeyEdit *ctx, gp
78          int uid = ctx->getUseridIndex ();          int uid = ctx->getUseridIndex ();
79          ctx->cmd_sent = 1;          ctx->cmd_sent = 1;
80          if (uid != -1) {          if (uid != -1) {
81              sprintf (buf, "uid %d", ctx->getUseridIndex ());              _snprintf (buf, DIM (buf)-1, "uid %d", ctx->getUseridIndex ());
82              return buf;              return buf;
83          }          }
84      }      }
# Line 113  cmd_sign_handler (GpgKeyEdit *ctx, gpgme Line 110  cmd_sign_handler (GpgKeyEdit *ctx, gpgme
110      if (ctx->getUseridIndex () != -1 &&      if (ctx->getUseridIndex () != -1 &&
111          ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {          ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {
112          ctx->cnt++;          ctx->cnt++;
113          sprintf (buf, "uid %d", ctx->getUseridIndex ());          _snprintf (buf, DIM (buf)-1, "uid %d", ctx->getUseridIndex ());
114          return buf;          return buf;
115      }      }
116    
# Line 216  cmd_deluid_handler (GpgKeyEdit *ctx, gpg Line 213  cmd_deluid_handler (GpgKeyEdit *ctx, gpg
213      static char buf[64];      static char buf[64];
214    
215      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {
216          sprintf (buf, "uid %d", ctx->getUseridIndex ());          _snprintf (buf, DIM (buf)-1, "uid %d", ctx->getUseridIndex ());
217          ctx->cnt = 1;          ctx->cnt = 1;
218          return buf;          return buf;
219      }      }
# Line 244  cmd_delsig_handler (GpgKeyEdit *ctx, gpg Line 241  cmd_delsig_handler (GpgKeyEdit *ctx, gpg
241      static int sig_cnt = 0;      static int sig_cnt = 0;
242    
243      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {
244          sprintf (buf, "uid %d", ctx->getUseridIndex ());          _snprintf (buf, DIM (buf)-1, "uid %d", ctx->getUseridIndex ());
245          ctx->cnt = 1;          ctx->cnt = 1;
246          return buf;          return buf;
247      }      }
# Line 278  cmd_delkey_handler (GpgKeyEdit *ctx, gpg Line 275  cmd_delkey_handler (GpgKeyEdit *ctx, gpg
275      static char buf[64];      static char buf[64];
276    
277      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {
278          sprintf (buf, "key %d", ctx->getKeyIndex ());          _snprintf (buf, DIM (buf)-1, "key %d", ctx->getKeyIndex ());
279          ctx->cnt = 1;          ctx->cnt = 1;
280          return buf;          return buf;
281      }      }
# Line 432  cmd_primary_handler (GpgKeyEdit *ctx, gp Line 429  cmd_primary_handler (GpgKeyEdit *ctx, gp
429      static char buf[64];      static char buf[64];
430            
431      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {
432          sprintf (buf, "uid %d", ctx->getUseridIndex ());          _snprintf (buf, DIM (buf)-1, "uid %d", ctx->getUseridIndex ());
433          ctx->cnt = 1;          ctx->cnt = 1;
434          return buf;          return buf;
435      }      }
# Line 460  cmd_expire_handler (GpgKeyEdit *ctx, gpg Line 457  cmd_expire_handler (GpgKeyEdit *ctx, gpg
457      static char buf[64];      static char buf[64];
458    
459      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {
460          sprintf (buf, "key %d", ctx->getKeyIndex ());          _snprintf (buf, DIM (buf)-1, "key %d", ctx->getKeyIndex ());
461          ctx->cnt = 1;          ctx->cnt = 1;
462          return buf;          return buf;
463      }      }
# Line 495  cmd_revuid_handler (GpgKeyEdit *ctx, gpg Line 492  cmd_revuid_handler (GpgKeyEdit *ctx, gpg
492            
493      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt")) {
494          ctx->cnt = 1;          ctx->cnt = 1;
495          sprintf (buf, "uid %d", ctx->getUseridIndex ());          _snprintf (buf, DIM (buf)-1, "uid %d", ctx->getUseridIndex ());
496          return buf;          return buf;
497      }      }
498      else if (ctx->cnt == 1 && !strcmp (key, "keyedit.prompt")) {      else if (ctx->cnt == 1 && !strcmp (key, "keyedit.prompt")) {
# Line 537  cmd_revsig_handler (GpgKeyEdit *ctx, gpg Line 534  cmd_revsig_handler (GpgKeyEdit *ctx, gpg
534      static char buf[64];      static char buf[64];
535            
536      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt" )) {      if (ctx->cnt == 0 && !strcmp (key, "keyedit.prompt" )) {
537          sprintf( buf, "uid %d", ctx->getUseridIndex ());          _snprintf (buf, DIM (buf)-1, "uid %d", ctx->getUseridIndex ());
538          ctx->cnt = 1;          ctx->cnt = 1;
539          return buf;          return buf;
540      }      }
# Line 586  cmd_revkey_handler (GpgKeyEdit *ctx, gpg Line 583  cmd_revkey_handler (GpgKeyEdit *ctx, gpg
583      static char buf[64];      static char buf[64];
584    
585      if (ctx->cnt == 0 && !strcmp ( key, "keyedit.prompt" ) ) {      if (ctx->cnt == 0 && !strcmp ( key, "keyedit.prompt" ) ) {
586          sprintf( buf, "key %d", ctx->getKeyIndex ());          _snprintf (buf, DIM (buf)-1, "key %d", ctx->getKeyIndex ());
587          ctx->cnt = 1;          ctx->cnt = 1;
588          return buf;          return buf;
589      }      }

Legend:
Removed from v.277  
changed lines
  Added in v.278

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26