mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-10-06 18:02:52 +02:00
graphics/grDStyle.c: Incorrect return-value check for a 'scanf'-like function
Fix code scanning alert no. 151: Incorrect return-value check for a 'scanf'-like function (#7) * Create codeql.yml * Fix code scanning alert no. 151: Incorrect return-value check for a 'scanf'-like function Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Update grDStyle.c * AI suggested '< 1', DLM edited to '<= 0' easier for a human to reason about ? --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
committed by
Tim Edwards
co-authored by
Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
parent
64d94ae588
commit
39e76f3f31
+1
-1
@@ -229,7 +229,7 @@ styleBuildDisplayStyle(line, version)
|
||||
*/
|
||||
|
||||
/* Allow colors to be specified by index or by name */
|
||||
if (sscanf(colorName, ((version > 6) ? "%i" : "%o"), &color) == 0)
|
||||
if (sscanf(colorName, ((version > 6) ? "%i" : "%o"), &color) <= 0)
|
||||
color = GrNameToColor(colorName);
|
||||
|
||||
newstyle->style.mask = (mask & grBitPlaneMask);
|
||||
|
||||
Reference in New Issue
Block a user