diff options
author | Bushman, Jeff <JBushman@ciena.com> | 2012-05-16 15:50:25 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@redhat.com> | 2012-05-18 13:03:46 (GMT) |
commit | ca883b61bc88498309afb82be9c8fa071febc741 (patch) | |
tree | 3543b47813bfde052dfca68cfdb00df5118f628c /lib/object.c | |
parent | 24d577c93dc0b3382d45ca8b29d3226e182e0669 (diff) | |
download | libnl-ca883b61bc88498309afb82be9c8fa071febc741.zip libnl-ca883b61bc88498309afb82be9c8fa071febc741.tar.gz libnl-ca883b61bc88498309afb82be9c8fa071febc741.tar.bz2 |
Fix for dumping objects to a buffer instead of file descriptor
Attached is a patch to fix two problems with dumping objects to a buffer in=
stead of a file descriptor.
One was a problem in detecting the end of the buffer in the newline code.
The other was a problem with clearing the whole buffer before printing each=
object.
Diffstat (limited to 'lib/object.c')
-rw-r--r-- | lib/object.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/object.c b/lib/object.c index 7606535..df1c963 100644 --- a/lib/object.c +++ b/lib/object.c @@ -259,6 +259,9 @@ int nl_object_is_marked(struct nl_object *obj) */ void nl_object_dump(struct nl_object *obj, struct nl_dump_params *params) { + if (params->dp_buf) + memset(params->dp_buf, 0, params->dp_buflen); + dump_from_ops(obj, params); } |