[augeas-devel] augeas: master - * src/info.c (print_info): do not choke on NULL info
David Lutterkort
lutter at fedoraproject.org
Fri Nov 13 19:26:43 UTC 2009
Gitweb: http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=0ee252f97c269ecd1c1e65cc6748dc83feaeaade
Commit: 0ee252f97c269ecd1c1e65cc6748dc83feaeaade
Parent: d71dcf482c9c71a6c2c21d113603b0a3e0bf40bf
Author: David Lutterkort <lutter at redhat.com>
AuthorDate: Tue Nov 10 09:16:52 2009 -0800
Committer: David Lutterkort <lutter at redhat.com>
CommitterDate: Thu Nov 12 16:25:16 2009 -0800
* src/info.c (print_info): do not choke on NULL info
---
src/info.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/info.c b/src/info.c
index 278fb60..2e1a503 100644
--- a/src/info.c
+++ b/src/info.c
@@ -83,6 +83,10 @@ char *format_info(struct info *info) {
}
void print_info(FILE *out, struct info *info) {
+ if (info == NULL) {
+ fprintf(out, "(no file info):");
+ return;
+ }
fprintf(out, "%s:",
info->filename != NULL ? info->filename->str : "(unknown file)");
if (info->first_line > 0) {
More information about the augeas-devel
mailing list