From 6d18c33068e60c3cbf091a294c28ff2e0cda04c6 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Thu, 17 Sep 2020 15:52:17 -0400 Subject: [PATCH] [ion/simulator] State files can have a wildcard version --- ion/src/simulator/shared/state_file.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ion/src/simulator/shared/state_file.cpp b/ion/src/simulator/shared/state_file.cpp index 9c23ba0bc..4b6e681ae 100644 --- a/ion/src/simulator/shared/state_file.cpp +++ b/ion/src/simulator/shared/state_file.cpp @@ -11,6 +11,7 @@ namespace StateFile { static constexpr const char * sHeader = "NWSF"; static constexpr int sHeaderLength = 4; static constexpr int sVersionLength = 8; +static constexpr const char * sWildcardVersion = "**.**.**"; /* File format: * "NWSF" + "XXXXXXXX" (version) + EVENTS... */ @@ -31,7 +32,7 @@ static inline bool load(FILE * f) { if (fread(buffer, sVersionLength, 1, f) != 1) { return false; } - if (strcmp(buffer, softwareVersion()) != 0) { + if (strcmp(buffer, softwareVersion()) != 0 && strcmp(buffer, sWildcardVersion) != 0) { return false; }