aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-06-16 22:21:48 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-06-16 22:21:48 +0300
commitb421abe2b1aa70f8077e5c41c199245790d9349b (patch)
tree658d3274be4b1c7761422713cfc8539dd7f43015
parent09dc31a240626db0b0de7047ee2c9f6978b14585 (diff)
parentb5c92588dc5972fab63ee2b2b8983a74e6fa5872 (diff)
downloadegawk-b421abe2b1aa70f8077e5c41c199245790d9349b.tar.gz
egawk-b421abe2b1aa70f8077e5c41c199245790d9349b.tar.bz2
egawk-b421abe2b1aa70f8077e5c41c199245790d9349b.zip
Merge branch 'master' into feature/cmake
-rw-r--r--ChangeLog6
-rw-r--r--awk.h10
-rw-r--r--builtin.c1
3 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f94b952..be06d36e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-06-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h: Add comment headers for several functions.
+ * builtin.c (nondec2awknum): Actually set a '\0' before
+ calling to strtod() so that the save and restore do something.
+
2016-06-15 Arnold D. Robbins <arnold@skeeve.com>
* config.sub: Update from GNULIB.
diff --git a/awk.h b/awk.h
index 9084e0d3..bee0e125 100644
--- a/awk.h
+++ b/awk.h
@@ -1778,6 +1778,8 @@ dupnode(NODE *n)
}
#endif
+/* force_string --- force a node to have a string value */
+
static inline NODE *
force_string(NODE *s)
{
@@ -1796,6 +1798,8 @@ force_string(NODE *s)
#define force_number str2number
#else /* not GAWKDEBUG */
+/* unref --- decrease the reference count and/or free a node */
+
static inline void
unref(NODE *r)
{
@@ -1803,6 +1807,8 @@ unref(NODE *r)
r_unref(r);
}
+/* force_number --- force a node to have a numeric value */
+
static inline NODE *
force_number(NODE *n)
{
@@ -1814,6 +1820,8 @@ force_number(NODE *n)
#endif /* GAWKDEBUG */
+/* emalloc_real --- malloc with error checking */
+
static inline void *
emalloc_real(size_t count, const char *where, const char *var, const char *file, int line)
{
@@ -1830,6 +1838,8 @@ emalloc_real(size_t count, const char *where, const char *var, const char *file,
return ret;
}
+/* erealloc_real --- realloc with error checking */
+
static inline void *
erealloc_real(void *ptr, size_t count, const char *where, const char *var, const char *file, int line)
{
diff --git a/builtin.c b/builtin.c
index 888fa10c..2d7101d8 100644
--- a/builtin.c
+++ b/builtin.c
@@ -3639,6 +3639,7 @@ nondec2awknum(char *str, size_t len)
} else {
decimal:
save = str[len];
+ str[len] = '\0';
retval = strtod(str, NULL);
str[len] = save;
}