diff options
Diffstat (limited to 'scd')
-rw-r--r-- | scd/ChangeLog | 5 | ||||
-rw-r--r-- | scd/command.c | 37 |
2 files changed, 6 insertions, 36 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog index efd46fea9..534a7092b 100644 --- a/scd/ChangeLog +++ b/scd/ChangeLog @@ -1,3 +1,8 @@ +2009-03-31 Werner Koch <[email protected]> + + * command.c (percent_plus_unescape): Remove. + (cmd_setattr): Use percent_plus_unescape_inplace. + 2009-03-30 Werner Koch <[email protected]> * app-nks.c (do_decipher): Make it work for TCOS 3. diff --git a/scd/command.c b/scd/command.c index 71081b26f..6c1cdd072 100644 --- a/scd/command.c +++ b/scd/command.c @@ -462,41 +462,6 @@ open_card (ctrl_t ctrl, const char *apptype) } -/* Do the percent and plus/space unescaping in place and return the - length of the valid buffer. */ -static size_t -percent_plus_unescape (unsigned char *string) -{ - unsigned char *p = string; - size_t n = 0; - - while (*string) - { - if (*string == '%' && string[1] && string[2]) - { - string++; - *p++ = xtoi_2 (string); - n++; - string+= 2; - } - else if (*string == '+') - { - *p++ = ' '; - n++; - string++; - } - else - { - *p++ = *string++; - n++; - } - } - - return n; -} - - - /* SERIALNO [APPTYPE] Return the serial number of the card using a status reponse. This @@ -1153,7 +1118,7 @@ cmd_setattr (assuan_context_t ctx, char *orig_line) *line++ = 0; while (spacep (line)) line++; - nbytes = percent_plus_unescape ((unsigned char*)line); + nbytes = percent_plus_unescape_inplace (line, 0); rc = app_setattr (ctrl->app_ctx, keyword, pin_cb, ctx, (const unsigned char*)line, nbytes); |