diff options
| author | Werner Koch <[email protected]> | 2004-04-13 09:45:23 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2004-04-13 09:45:23 +0000 |
| commit | 5b9023c6e7b55f66845821544514c7a11e687bb7 (patch) | |
| tree | 32ba63075d14cc01cf9960c0f829a985b7933ade /common/simple-pwquery.c | |
| parent | (gpgsm_decrypt): Return GPG_ERR_NO_DATA if it is not a (diff) | |
| download | gnupg-5b9023c6e7b55f66845821544514c7a11e687bb7.tar.gz gnupg-5b9023c6e7b55f66845821544514c7a11e687bb7.zip | |
(copy_and_escape): Relaxed quoting.
Diffstat (limited to 'common/simple-pwquery.c')
| -rw-r--r-- | common/simple-pwquery.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/common/simple-pwquery.c b/common/simple-pwquery.c index 50dabc218..36244b120 100644 --- a/common/simple-pwquery.c +++ b/common/simple-pwquery.c @@ -357,19 +357,21 @@ static char * copy_and_escape (char *buffer, const char *text) { int i; + const unsigned char *s = text; char *p = buffer; + - for (i=0; text[i]; i++) + for (i=0; s[i]; i++) { - if (text[i] < ' ' || text[i] == '+') + if (s[i] < ' ' || s[i] == '+') { - sprintf (p, "%%%02X", text[i]); + sprintf (p, "%%%02X", s[i]); p += 3; } - else if (text[i] == ' ') + else if (s[i] == ' ') *p++ = '+'; else - *p++ = text[i]; + *p++ = s[i]; } return p; } |
