summaryrefslogtreecommitdiffstats
path: root/common/simple-pwquery.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/simple-pwquery.c')
-rw-r--r--common/simple-pwquery.c12
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;
}