aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ui-file.c')
-rw-r--r--gdb/ui-file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/ui-file.c b/gdb/ui-file.c
index 02a0314..527917c 100644
--- a/gdb/ui-file.c
+++ b/gdb/ui-file.c
@@ -285,8 +285,7 @@ do_ui_file_xstrdup (void *context, const char *buffer, long length)
}
char *
-ui_file_xstrdup (struct ui_file *file,
- long *length)
+ui_file_xstrdup (struct ui_file *file, long *length)
{
struct accumulated_ui_file acc;
acc.buffer = NULL;
@@ -294,7 +293,8 @@ ui_file_xstrdup (struct ui_file *file,
ui_file_put (file, do_ui_file_xstrdup, &acc);
if (acc.buffer == NULL)
acc.buffer = xstrdup ("");
- *length = acc.length;
+ if (length != NULL)
+ *length = acc.length;
return acc.buffer;
}