Queryformat string sanity in queryArgCallback()

- Use our string helper functions instead of manual length calculations
  and allocations
This commit is contained in:
Panu Matilainen 2010-09-21 14:50:40 +03:00
parent 6255825811
commit 5d79b79c1b
1 changed files with 2 additions and 5 deletions

View File

@ -143,12 +143,9 @@ static void queryArgCallback(poptContext con,
if (arg) {
char * qf = (char *)qva->qva_queryFormat;
if (qf) {
size_t len = strlen(qf) + strlen(arg) + 1;
qf = xrealloc(qf, len);
strcat(qf, arg);
rstrcat(&qf, arg);
} else {
qf = xmalloc(strlen(arg) + 1);
strcpy(qf, arg);
qf = xstrdup(arg);
}
qva->qva_queryFormat = qf;
}