aboutsummaryrefslogtreecommitdiffstats
path: root/lib/src/policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/policy.c')
-rw-r--r--lib/src/policy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/src/policy.c b/lib/src/policy.c
index 336249bbb..edbb02bea 100644
--- a/lib/src/policy.c
+++ b/lib/src/policy.c
@@ -49,6 +49,8 @@ policy_tag_state_snprintf(char * s, size_t size, const policy_tag_state_t * tag_
return -1;
rc = snprintf(cur, s + size - cur, "%s%s", (tag_state->disabled == 1) ? "!" : "", policy_state_str[tag_state->state]);
+ if (rc >= s + size - cur)
+ return s + size - cur;
if (rc < 0)
return rc;
cur += rc;