From 6152f621baf184ed0f7d0658c9ee058a74b5cde4 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 20 Jun 2021 06:47:52 -0400 Subject: [PATCH] microoptimize extract_version() --- src/lib/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/input.c b/src/lib/input.c index bd7a118a8..bee388db9 100644 --- a/src/lib/input.c +++ b/src/lib/input.c @@ -724,7 +724,7 @@ ruts_string(query_state* inits, initstates_e state){ // extract the terminal version from the running string, following 'prefix' static int extract_version(query_state* qstate, const char* prefix){ - size_t bytes = strlen(qstate->runstring) - strlen(prefix) + 1; + size_t bytes = strlen(qstate->runstring + strlen(prefix)) + 1; qstate->version = malloc(bytes); if(qstate->version == NULL){ return -1;