[daemon-fix] fixed querying about name information
[platform/upstream/dbus.git] / dbus / dbus-uuidgen.c
index 8da8396..6d7c0ae 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- mode: C; c-file-style: "gnu" -*- */
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /* dbus-uuidgen.c  The guts of the dbus-uuidgen binary live in libdbus, in this file.
  *
  * Copyright (C) 2006  Red Hat, Inc.
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
+#include <config.h>
 #include "dbus-uuidgen.h"
 #include "dbus-internals.h"
 #include "dbus-string.h"
@@ -48,7 +49,13 @@ return_uuid (DBusGUID   *uuid,
   if (uuid_p)
     {
       DBusString encoded;
-      _dbus_string_init (&encoded);
+
+      if (!_dbus_string_init (&encoded))
+        {
+          _DBUS_SET_OOM (error);
+          return FALSE;
+        }
+
       if (!_dbus_uuid_encode (uuid, &encoded) ||
           !_dbus_string_steal_data (&encoded, uuid_p))
         {
@@ -70,7 +77,7 @@ return_uuid (DBusGUID   *uuid,
  * @param uuid_p out param to return the uuid
  * @param create_if_not_found whether to create it if not already there
  * @param error error return
- * @param returns #FALSE if error is set
+ * @returns #FALSE if error is set
  */
 dbus_bool_t
 dbus_internal_do_not_use_get_uuid (const char *filename,
@@ -109,7 +116,7 @@ dbus_internal_do_not_use_get_uuid (const char *filename,
  * the libdbus soname.
  *
  * @param uuid_p out param to return the uuid
- * @param returns #FALSE if no memory
+ * @returns #FALSE if no memory
  */
 dbus_bool_t
 dbus_internal_do_not_use_create_uuid (char      **uuid_p)