diff options
Diffstat (limited to 'src/format.c')
-rw-r--r-- | src/format.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/format.c b/src/format.c index d010729..cff4019 100644 --- a/src/format.c +++ b/src/format.c @@ -1,5 +1,5 @@ /* grecs - Gray's Extensible Configuration System - Copyright (C) 2007-2012 Sergey Poznyakoff + Copyright (C) 2007-2015 Sergey Poznyakoff Grecs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -242,6 +242,11 @@ grecs_format_node_path(struct grecs_node *node, int flags, { char delim[2] = "."; + if (!node) { + clos->fmtfun("NULL", clos->data); + return; + } + if (node->up) grecs_format_node_path(node->up, flags, clos); if (node->type == grecs_node_root) @@ -321,6 +326,11 @@ grecs_format_node(struct grecs_node *node, int flags, return 1; } + if (!node) { + clos->fmtfun("NULL", clos->data); + return 0; + } + switch (node->type) { case grecs_node_root: case grecs_node_block: |