Skip to content

Commit 0371a28

Browse files
pradeebanCopilot
andauthored
Update concore_default_maxtime.m
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f209689 commit 0371a28

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

concore_default_maxtime.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ function concore_default_maxtime(default)
66
% Safe numeric parsing (replaces unsafe eval)
77
clean_str = strtrim(instr);
88
clean_str = regexprep(clean_str, '[\[\]]', '');
9-
concore.maxtime = sscanf(clean_str, '%f');
9+
% Normalize commas to whitespace so sscanf can parse all tokens
10+
clean_str = strrep(clean_str, ',', ' ');
11+
parsed_values = sscanf(clean_str, '%f');
12+
if numel(parsed_values) == 1
13+
concore.maxtime = parsed_values;
14+
else
15+
concore.maxtime = default;
16+
end
1017
fclose(maxfile);
1118
catch exc
1219
concore.maxtime = default;

0 commit comments

Comments
 (0)