diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | awk.h | 10 | ||||
-rw-r--r-- | builtin.c | 1 |
3 files changed, 17 insertions, 0 deletions
@@ -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. @@ -1763,6 +1763,8 @@ dupnode(NODE *n) } #endif +/* force_string --- force a node to have a string value */ + static inline NODE * force_string(NODE *s) { @@ -1778,6 +1780,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) { @@ -1785,6 +1789,8 @@ unref(NODE *r) r_unref(r); } +/* force_number --- force a node to have a numeric value */ + static inline NODE * force_number(NODE *n) { @@ -1793,6 +1799,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) { @@ -1809,6 +1817,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) { @@ -3520,6 +3520,7 @@ nondec2awknum(char *str, size_t len) } else { decimal: save = str[len]; + str[len] = '\0'; retval = strtod(str, NULL); str[len] = save; } |