summaryrefslogtreecommitdiff
path: root/gio/src/unixfdmessage.ccg
diff options
context:
space:
mode:
Diffstat (limited to 'gio/src/unixfdmessage.ccg')
-rw-r--r--gio/src/unixfdmessage.ccg9
1 files changed, 4 insertions, 5 deletions
diff --git a/gio/src/unixfdmessage.ccg b/gio/src/unixfdmessage.ccg
index ec38df44..7849a208 100644
--- a/gio/src/unixfdmessage.ccg
+++ b/gio/src/unixfdmessage.ccg
@@ -1,5 +1,3 @@
-// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-
/* Copyright (C) 2010 The giomm Development Team
*
* This library is free software; you can redistribute it and/or
@@ -27,9 +25,10 @@ namespace Gio
Glib::ArrayHandle<int> UnixFDMessage::steal_fds()
{
int length = 0;
- const int* fds = g_unix_fd_message_steal_fds(gobj(), &length);
- // (length - 1) is used because the array is terminated with a -1.
- return Glib::ArrayHandle<int>(fds, length - 1, Glib::OWNERSHIP_DEEP);
+ const auto fds = g_unix_fd_message_steal_fds(gobj(), &length);
+ // The array is terminated with a -1, but that terminating element is
+ // not included in the length that g_unix_fd_message_steal_fds() returns.
+ return Glib::ArrayHandle<int>(fds, length, Glib::OWNERSHIP_DEEP);
}
} // namespace Gio