- if (!_dbus_string_append_int (str, i))
- {
- _dbus_string_free (str);
- return FALSE;
- }
+ /* start out with 1-0, go to 1-1, 1-2, 1-3,
+ * up to 1-MAXINT, then 2-0, 2-1, etc.
+ */
+ if (next_minor_number <= 0)
+ {
+ next_major_number += 1;
+ next_minor_number = 0;
+ if (next_major_number <= 0)
+ _dbus_assert_not_reached ("INT_MAX * INT_MAX clients were added");
+ }
+
+ _dbus_assert (next_major_number > 0);
+ _dbus_assert (next_minor_number >= 0);
+
+ /* appname:MAJOR-MINOR */
+
+ if (!_dbus_string_append (str, ":"))
+ return FALSE;
+
+ if (!_dbus_string_append_int (str, next_major_number))
+ return FALSE;
+
+ if (!_dbus_string_append (str, "-"))
+ return FALSE;
+
+ if (!_dbus_string_append_int (str, next_minor_number))
+ return FALSE;
+
+ next_minor_number += 1;