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

Diff of /trunk/Src/wptClipEncryptDlg.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 39  Line 39 
39  #include "wptRegistry.h"  #include "wptRegistry.h"
40  #include "wptDlgs.h"  #include "wptDlgs.h"
41  #include "wptUTF8.h"  #include "wptUTF8.h"
42    #include "StringBuffer.h"
43    
44    
45  /* Encrypt the contents of the clipboard with the keys in @rset.  /* Encrypt the contents of the clipboard with the keys in @rset.
# Line 99  show_invalid_recipients (HWND dlg, gpgme Line 100  show_invalid_recipients (HWND dlg, gpgme
100      gpgme_encrypt_result_t res;      gpgme_encrypt_result_t res;
101      gpgme_invalid_key_t k;      gpgme_invalid_key_t k;
102      gpgme_key_t key;      gpgme_key_t key;
103        StringBuffer p;
104      size_t len=0;      size_t len=0;
105      const char *keyid;      const char *keyid;
106      const char *warn = _("key not found");      const char *warn = _("key not found");
107      char *uid, *p;      char *uid;
108    
109      if (!ctx)      if (!ctx)
110          return -1;          return -1;
# Line 117  show_invalid_recipients (HWND dlg, gpgme Line 119  show_invalid_recipients (HWND dlg, gpgme
119              len += strlen (warn) + strlen (k->fpr)+8 + 2 + 4;              len += strlen (warn) + strlen (k->fpr)+8 + 2 + 4;
120      }      }
121    
122      p = (char *)calloc (1, len+64);      p = _("Recipients unsuable for encryption:\n");
     if (!p)  
         BUG (NULL);  
     strcpy (p, _("Recipients unsuable for encryption:\n"));  
123      for (k = res->invalid_recipients; k; k = k->next) {      for (k = res->invalid_recipients; k; k = k->next) {
124          if (!get_pubkey (k->fpr, &key)) {          if (!get_pubkey (k->fpr, &key)) {
125              uid = utf8_to_native (key->uids->name);              uid = utf8_to_native (key->uids->name);
# Line 130  show_invalid_recipients (HWND dlg, gpgme Line 129  show_invalid_recipients (HWND dlg, gpgme
129              uid = strdup (warn);              uid = strdup (warn);
130              keyid = k->fpr;              keyid = k->fpr;
131          }          }
132          strcat (p, keyid);          p = p + keyid + " : " + uid + "\n";
         strcat (p, " : ");  
         strcat (p, uid);  
         strcat (p, "\n");  
133          safe_free (uid);          safe_free (uid);
134      }      }
135      msg_box (dlg, p, _("Encryption"), MB_ERR);      msg_box (dlg, p.getBuffer (), _("Encryption"), MB_ERR);
     safe_free (p);  
136      return 0;      return 0;
137  }  }
138    

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26