File tree 2 files changed +6
-15
lines changed
2 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -285,12 +285,8 @@ foreach(file ${_update_files})
285
285
endforeach ()
286
286
287
287
# Convert the list to a C array
288
- set (COMPATIBLE_VERSIONS_ARRAY "" )
289
- foreach (version ${COMPATIBLE_VERSIONS_LIST} )
290
- set (COMPATIBLE_VERSIONS_ARRAY "${COMPATIBLE_VERSIONS_ARRAY} \" ${version} \" , " )
291
- endforeach ()
292
- string (REGEX REPLACE ", $|,$" "" COMPATIBLE_VERSIONS_ARRAY "${COMPATIBLE_VERSIONS_ARRAY} " )
293
- set (COMPATIBLE_VERSIONS_ARRAY "{ ${COMPATIBLE_VERSIONS_ARRAY} }" )
288
+ string (JOIN "\" ,\" " COMPATIBLE_VERSIONS_ARRAY ${COMPATIBLE_VERSIONS_LIST} )
289
+ set (COMPATIBLE_VERSIONS_ARRAY "{ \" ${COMPATIBLE_VERSIONS_ARRAY} \" }" )
294
290
list (LENGTH COMPATIBLE_VERSIONS_LIST COMPATIBLE_VERSIONS_COUNT)
295
291
296
292
add_custom_command (
Original file line number Diff line number Diff line change 22
22
#include "usearch_storage.hpp"
23
23
#include "version.h"
24
24
25
- bool version_checked = false;
26
- bool versions_match = true ;
27
- char * catalog_version = "unknown" ;
25
+ bool version_checked = false;
26
+ bool versions_match = false ;
27
+ char catalog_version [ NAMEDATALEN ] = "unknown" ;
28
28
29
29
static const char * COMPATIBLE_VERSIONS [ LDB_COMPATIBLE_VERSIONS_COUNT ] = LDB_COMPATIBLE_VERSIONS ;
30
30
@@ -189,12 +189,7 @@ void CheckExtensionVersions()
189
189
190
190
// Grab the result and check that it matches the version in the generated header
191
191
version_text = DatumGetTextP (val );
192
- catalog_version = text_to_cstring (version_text );
193
-
194
- if (strlen (catalog_version ) == 0 ) {
195
- SPI_finish ();
196
- return ;
197
- }
192
+ strncpy (catalog_version , text_to_cstring (version_text ), NAMEDATALEN );
198
193
199
194
if (strcmp (catalog_version , LDB_BINARY_VERSION ) == 0 ) {
200
195
versions_match = true;
You can’t perform that action at this time.
0 commit comments