[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/4] gui: Fix Glib-GObject-WARNING when closing the active da
From: |
John Darrington |
Subject: |
Re: [PATCH 1/4] gui: Fix Glib-GObject-WARNING when closing the active dataset. |
Date: |
Sun, 8 Jul 2012 07:05:47 +0000 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Sat, Jul 07, 2012 at 11:49:13PM -0700, Ben Pfaff wrote:
The DATASET CLOSE command, when it act on the active dataset, just
^^^
This verb is incorrectly conjugated.
+/* Returns an identifier that is is not currently in use as a dataset
name. */
+char *
+session_generate_dataset_name (struct session *s)
+{
+ for (;;)
+ {
+ char *name = xasprintf ("DataSet%d", ++s->n_dataset_names);
+ if (!session_lookup_dataset (s, name))
+ return name;
+ free (name);
+ }
+}
I suppose it's unlikely, but this loop could become endless. Might it not be an
idea to check that n_dataset_names is non-negative?
Also, perhaps the comment should say that the caller should free the returned
name.
J'
--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.
signature.asc
Description: Digital signature
[PATCH 2/4] psppire-dict: Make PsppireDict not own its "struct dictionary"., Ben Pfaff, 2012/07/08