File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -285,12 +285,8 @@ foreach(file ${_update_files})
285285endforeach ()
286286
287287# 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} \" }" )
294290list (LENGTH COMPATIBLE_VERSIONS_LIST COMPATIBLE_VERSIONS_COUNT)
295291
296292add_custom_command (
Original file line number Diff line number Diff line change 2222#include "usearch_storage.hpp"
2323#include "version.h"
2424
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" ;
2828
2929static const char * COMPATIBLE_VERSIONS [ LDB_COMPATIBLE_VERSIONS_COUNT ] = LDB_COMPATIBLE_VERSIONS ;
3030
@@ -189,12 +189,7 @@ void CheckExtensionVersions()
189189
190190 // Grab the result and check that it matches the version in the generated header
191191 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 );
198193
199194 if (strcmp (catalog_version , LDB_BINARY_VERSION ) == 0 ) {
200195 versions_match = true;
You can’t perform that action at this time.
0 commit comments