368 |
} |
} |
369 |
|
|
370 |
|
|
371 |
|
/* Return the status of the key @key. */ |
372 |
char* |
char* |
373 |
get_key_status (gpgme_key_t key, int uididx, int listmode) |
get_key_status (gpgme_key_t key, int uididx, int listmode) |
374 |
{ |
{ |
375 |
gpgme_user_id_t u; |
gpgme_user_id_t u; |
376 |
char * p; |
const char *attr; |
|
const char * attr; |
|
377 |
int i = 0; |
int i = 0; |
378 |
u32 key_attr =0; |
u32 key_attr =0; |
379 |
|
|
399 |
u = get_nth_userid (key, uididx); |
u = get_nth_userid (key, uididx); |
400 |
key_attr = u->validity; |
key_attr = u->validity; |
401 |
attr = get_key_trust2 (NULL, key_attr, 0, 0); |
attr = get_key_trust2 (NULL, key_attr, 0, 0); |
402 |
/* FIXME: Why not just strdup and why does this function either |
return m_strdup (attr); |
403 |
* return a new allocated or an m_strdup allocated string? This |
} |
|
* is very dangerous!!! */ |
|
|
p = new char[strlen( attr ) + 2]; |
|
|
if (!p) |
|
|
BUG (NULL); |
|
|
strcpy (p, attr); |
|
|
return p; |
|
|
} /* get_key_status */ |
|
404 |
|
|
405 |
|
|
406 |
/* Integer comparsion of @a and @b. |
/* Integer comparsion of @a and @b. |