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) {
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue