From b6a8c9df4df236d70ef9001420af7705ae62526b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Fri, 18 Oct 2019 23:30:27 +0200 Subject: [PATCH] virsh: getSignalNumber: rename variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use 'str' for the allocated copy of the string and 'p' for the pointer into that string. Signed-off-by: Ján Tomko Reviewed-by: Daniel Henrique Barboza --- tools/virsh-domain.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 715ad51ef5..d74a671167 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8806,26 +8806,26 @@ static int getSignalNumber(vshControl *ctl, const char *signame) { size_t i; int signum; - char *lower = vshStrdup(ctl, signame); - char *tmp = lower; + char *str = vshStrdup(ctl, signame); + char *p = str; for (i = 0; signame[i]; i++) - lower[i] = c_tolower(signame[i]); + p[i] = c_tolower(signame[i]); - if (virStrToLong_i(lower, NULL, 10, &signum) >= 0) + if (virStrToLong_i(p, NULL, 10, &signum) >= 0) goto cleanup; - if (STRPREFIX(lower, "sig_")) - lower += 4; - else if (STRPREFIX(lower, "sig")) - lower += 3; + if (STRPREFIX(p, "sig_")) + p += 4; + else if (STRPREFIX(p, "sig")) + p += 3; - if ((signum = virDomainProcessSignalTypeFromString(lower)) >= 0) + if ((signum = virDomainProcessSignalTypeFromString(p)) >= 0) goto cleanup; signum = -1; cleanup: - VIR_FREE(tmp); + VIR_FREE(str); return signum; } -- GitLab