summaryrefslogtreecommitdiff
path: root/src/common/stringinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/stringinfo.c')
-rw-r--r--src/common/stringinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/stringinfo.c b/src/common/stringinfo.c
index b3d3c99b8c1..05b22b5c53c 100644
--- a/src/common/stringinfo.c
+++ b/src/common/stringinfo.c
@@ -211,8 +211,8 @@ appendStringInfoSpaces(StringInfo str, int count)
enlargeStringInfo(str, count);
/* OK, append the spaces */
- while (--count >= 0)
- str->data[str->len++] = ' ';
+ memset(&str->data[str->len], ' ', count);
+ str->len += count;
str->data[str->len] = '\0';
}
}