aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-03-03 20:55:06 +0200
committerArnold D. Robbins <arnold@skeeve.com>2016-03-03 20:55:06 +0200
commitb60cdd6dc30f9f4845f43b7ca17a490233ec3918 (patch)
tree44b7571ad5103baae460d1fa09c573c6c29274af
parent21b584ce481970c9022c08148a6adbc0e489c432 (diff)
downloadegawk-b60cdd6dc30f9f4845f43b7ca17a490233ec3918.tar.gz
egawk-b60cdd6dc30f9f4845f43b7ca17a490233ec3918.tar.bz2
egawk-b60cdd6dc30f9f4845f43b7ca17a490233ec3918.zip
Fix a compile warning in profile.c.
-rw-r--r--ChangeLog5
-rw-r--r--profile.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 67d81cf4..e1cb3d1c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-03 Arnold D. Robbins <arnold@skeeve.com>
+
+ * profile.c (pp_list): Unconditionally compute delimlen. Avoids
+ compiler warning.
+
2016-02-29 Arnold D. Robbins <arnold@skeeve.com>
* profile.c (pp_list): Handle the case of nargs equal to zero.
diff --git a/profile.c b/profile.c
index 178deb7e..842b04fb 100644
--- a/profile.c
+++ b/profile.c
@@ -1423,10 +1423,10 @@ pp_list(int nargs, const char *paren, const char *delim)
erealloc(pp_args, NODE **, (nargs + 2) * sizeof(NODE *), "pp_list");
}
+ delimlen = strlen(delim);
if (nargs == 0)
len = 2;
else {
- delimlen = strlen(delim);
len = -delimlen;
for (i = 1; i <= nargs; i++) {
r = pp_args[i] = pp_pop();