aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-09-22 16:57:11 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-09-22 16:57:11 +0300
commitda83b6857bf0a67b15fc75d31a0b6802ac9baffe (patch)
tree399e9f1ec800b5405f9b494060481a8420480caf /builtin.c
parente149eb882355f427d43928324145c971a0562c5e (diff)
parent8aa14c5f3cf78f90b589785a9ffe5f7f02050b37 (diff)
downloadegawk-da83b6857bf0a67b15fc75d31a0b6802ac9baffe.tar.gz
egawk-da83b6857bf0a67b15fc75d31a0b6802ac9baffe.tar.bz2
egawk-da83b6857bf0a67b15fc75d31a0b6802ac9baffe.zip
Merge branch 'master' into comment
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index b8e24cb3..9258ea60 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2159,7 +2159,7 @@ do_print_rec(int nargs, int redirtype)
f0 = fields_arr[0];
- if (do_lint && f0 == Nnull_string)
+ if (do_lint && (f0->flags & NULL_FIELD) != 0)
lintwarn(_("reference to uninitialized field `$%d'"), 0);
efwrite(f0->stptr, sizeof(char), f0->stlen, fp, "print", rp, false);
@@ -2955,13 +2955,16 @@ set_how_many:
done:
DEREF(s);
- if ((matches == 0 || (flags & LITERAL) != 0) && buf != NULL)
+ if ((matches == 0 || (flags & LITERAL) != 0) && buf != NULL) {
efree(buf);
+ buf = NULL;
+ }
if (flags & GENSUB) {
if (matches > 0) {
/* return the result string */
DEREF(t);
+ assert(buf != NULL);
return make_str_node(buf, textlen, ALREADY_MALLOCED);
}