summaryrefslogtreecommitdiffstats
path: root/src/opt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/opt.c')
-rw-r--r--src/opt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/opt.c b/src/opt.c
index bd0bc52..cd312ad 100644
--- a/src/opt.c
+++ b/src/opt.c
@@ -239,9 +239,9 @@ static int perf_opt_long_parse(char* optarg)
char* arg;
if ((arg = strchr(optarg, '='))) {
+ optlen = arg - optarg;
arg++;
- optlen = strlen(arg);
- if (optlen < 1) {
+ if (optlen < 1 || !strlen(arg)) {
return -1;
}
} else {