aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/config.c b/config.c
index b10f42b2..af93f419 100644
--- a/config.c
+++ b/config.c
@@ -651,7 +651,7 @@ value_to_pt_or_px(struct context *ctx, struct pt_or_px *res)
char *end = NULL;
long value = strtol(s, &end, 10);
- if (!(errno == 0 && end == s + len - 2)) {
+ if (!(len > 2 && errno == 0 && end == s + len - 2)) {
LOG_CONTEXTUAL_ERR("invalid px value (must be in the form 12px)");
return false;
}