mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 05:01:24 +00:00
[plist] Always calc string length
Making the string length calc based on !json was a mistake that resulted in running off the end of the dstring.
This commit is contained in:
parent
400486931f
commit
c0004ed7d5
1 changed files with 4 additions and 6 deletions
|
@ -1334,12 +1334,10 @@ write_string (dstring_t *dstr, const char *str, bool json)
|
|||
char *dst;
|
||||
bool quoted = json;
|
||||
|
||||
if (!quoted) {
|
||||
for (s = str; *s; s++) {
|
||||
if (is_quotable (*s))
|
||||
quoted = true;
|
||||
len++;
|
||||
}
|
||||
for (s = str; *s; s++) {
|
||||
if (is_quotable (*s))
|
||||
quoted = true;
|
||||
len++;
|
||||
}
|
||||
if (!quoted) {
|
||||
dst = dstring_openstr (dstr, len);
|
||||
|
|
Loading…
Reference in a new issue