From bf83ea12bd1e41fc8d6f13df99c4b5e77773b274 Mon Sep 17 00:00:00 2001 From: Olaf Dietsche Date: Wed, 8 Jul 2015 04:52:01 +0200 Subject: [PATCH] Skip trailing whitespace when reading config file. --- sysbench/sb_options.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sysbench/sb_options.c b/sysbench/sb_options.c index 398adaa..102e87d 100644 --- a/sysbench/sb_options.c +++ b/sysbench/sb_options.c @@ -670,7 +670,8 @@ sb_list_t *read_config(FILE *fp, sb_list_t *options) if (*tmp == VALUE_SEPARATOR) tmp++; } else { - for (optlen = 0; tmp[optlen] != '\0' && tmp[optlen] != VALUE_SEPARATOR; + for (optlen = 0; tmp[optlen] != '\0' && tmp[optlen] != VALUE_SEPARATOR + && !isspace(tmp[optlen]); optlen++) { /* Empty */