summaryrefslogtreecommitdiff
path: root/function.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-07-21 17:52:13 -0400
committerPaul Smith <psmith@gnu.org>2013-07-21 17:52:13 -0400
commit87ac68fe79a2e3b0d149135d40d8cbc5500024af (patch)
tree78ca3b513d6d7e662117fc824c40f2db2b521b85 /function.c
parent72462ef1e181fc99837ba3077f9b5d192f16f6aa (diff)
downloadgunmake-87ac68fe79a2e3b0d149135d40d8cbc5500024af.tar.gz
[Bug #39158] Source cleanups suggested by cppcheck utility.
Diffstat (limited to 'function.c')
-rw-r--r--function.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/function.c b/function.c
index 431c060..9eabd73 100644
--- a/function.c
+++ b/function.c
@@ -1113,7 +1113,6 @@ func_sort (char *o, char **argv, const char *funcname UNUSED)
int wordi;
char *p;
unsigned int len;
- int i;
/* Find the maximum number of words we'll have. */
t = argv[0];
@@ -1138,6 +1137,8 @@ func_sort (char *o, char **argv, const char *funcname UNUSED)
if (wordi)
{
+ int i;
+
/* Now sort the list of words. */
qsort (words, wordi, sizeof (char *), alpha_compare);
@@ -1281,12 +1282,12 @@ static char *
func_and (char *o, char **argv, const char *funcname UNUSED)
{
char *expansion;
- int result;
while (1)
{
const char *begp = *argv;
const char *endp = begp + strlen (*argv) - 1;
+ int result;
/* An empty condition is always false. */
strip_whitespace (&begp, &endp);