summaryrefslogtreecommitdiffstats
path: root/runtime/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/string.c')
-rw-r--r--runtime/string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/string.c b/runtime/string.c
index 1d4cb255..afef191a 100644
--- a/runtime/string.c
+++ b/runtime/string.c
@@ -68,10 +68,10 @@ static void _stp_text_str(char *outstr, char *in, int len, int quoted, int user)
{
char c, *out = outstr;
- if (len == 0 || len > MAXSTRINGLEN-1)
+ if (len <= 0 || len > MAXSTRINGLEN-1)
len = MAXSTRINGLEN-1;
if (quoted) {
- len -= 2;
+ len = max(len, 5) - 2;
*out++ = '"';
}