Queryformat string sanity in queryArgCallback()
- Use our string helper functions instead of manual length calculations and allocations
This commit is contained in:
parent
6255825811
commit
5d79b79c1b
|
@ -143,12 +143,9 @@ static void queryArgCallback(poptContext con,
|
||||||
if (arg) {
|
if (arg) {
|
||||||
char * qf = (char *)qva->qva_queryFormat;
|
char * qf = (char *)qva->qva_queryFormat;
|
||||||
if (qf) {
|
if (qf) {
|
||||||
size_t len = strlen(qf) + strlen(arg) + 1;
|
rstrcat(&qf, arg);
|
||||||
qf = xrealloc(qf, len);
|
|
||||||
strcat(qf, arg);
|
|
||||||
} else {
|
} else {
|
||||||
qf = xmalloc(strlen(arg) + 1);
|
qf = xstrdup(arg);
|
||||||
strcpy(qf, arg);
|
|
||||||
}
|
}
|
||||||
qva->qva_queryFormat = qf;
|
qva->qva_queryFormat = qf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue