<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.

</pre>
<p><a href="https://github.com/macports/macports-base/commit/9dbef5e22dcd4412b70f024ebefeb9df763b42e5">https://github.com/macports/macports-base/commit/9dbef5e22dcd4412b70f024ebefeb9df763b42e5</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 9dbef5e22dcd4412b70f024ebefeb9df763b42e5
</span>Author: Clemens Lang <cal@macports.org>
AuthorDate: Tue Oct 31 11:16:39 2023 +0100

<span style='display:block; white-space:pre;color:#404040;'>    cregistry: Move variable to avoid magic constant
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    It's not much of an improvement, but let's at least give the magic
</span><span style='display:block; white-space:pre;color:#404040;'>    number a name.
</span>---
 src/cregistry/snapshot.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/cregistry/snapshot.c b/src/cregistry/snapshot.c
</span><span style='display:block; white-space:pre;color:#808080;'>index 0afcbbf02..8a9c14133 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/cregistry/snapshot.c
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/cregistry/snapshot.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -304,16 +304,15 @@ int reg_snapshot_ports_get(reg_snapshot* snapshot, port*** ports, reg_error* err
</span> 
     if ((sqlite3_prepare_v2(reg->db, query, -1, &stmt, NULL) == SQLITE_OK)
         && (sqlite3_bind_int64(stmt, 1, snapshot->id) == SQLITE_OK )) {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+        int result_space = 10;
</span> 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        // TODO: why 10?
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        port** result = (port**)malloc(10 * sizeof(port*));
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        port** result = (port**)malloc(result_space * sizeof(port*));
</span> 
         if (!result) {
             return -1;
         }
 
         int result_count = 0;
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        int result_space = 10;
</span>         int r;
 
         sqlite_int64 snapshot_port_id;
</pre><pre style='margin:0'>

</pre>