diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-06-08 16:45:59 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-06-08 17:02:14 +0000 |
| commit | 85f5be05f66382c9f2095749d0edbd41f6e861a5 (patch) | |
| tree | cb865d916d07c11ce9875ab1f4f40770001929db /src/preferences-skeleton.h | |
| parent | Stop crash when Text > Outermost element is active (diff) | |
| download | inkscape-85f5be05f66382c9f2095749d0edbd41f6e861a5.tar.gz inkscape-85f5be05f66382c9f2095749d0edbd41f6e861a5.zip | |
Preferences: Work around issue with parsing unsigned integers
As we handle unsigned integers the same way as signed integers,
large unsigned values (notably RGBA values) overflow the signed type.
The issue became apparent when we switched from atoi to strtol in
0e92e8e519b33b35ab63600c31feb7c639e347a6
While the former has undefined behavior for out of range numbers
it luckily seemed to "just" overflow as expected on supported OSs.
The latter however returns LONG_MAX (which for a 32-bit value is
0x7fffffff and turned out to show turquoise in unexpected places,
e.g. the default path highlighting color in node tool).
Avoid this by catching the error and try to parse as unsigned type
in this case (which will still overflow, but seems to have worked
as expected so far).
Diffstat (limited to 'src/preferences-skeleton.h')
| -rw-r--r-- | src/preferences-skeleton.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 30ee465e5..72093ea70 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -133,7 +133,7 @@ R"=====( show_sample_in_list="1" use_svg2="0" style="fill:black;fill-opacity:1;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;" selcue="1"/> - <eventcontext id="nodes" selcue="1" gradientdrag="1" highlight_color="4278190335" pathflash_enabled="1" pathflash_unselected="0" pathflash_timeout="500" show_handles="1" show_outline="0" + <eventcontext id="nodes" selcue="1" gradientdrag="1" highlight_color="0xff0000ff" pathflash_enabled="1" pathflash_unselected="0" pathflash_timeout="500" show_handles="1" show_outline="0" sculpting_profile="1" single_node_transform_handles="0" show_transform_handles="0" live_outline="1" live_objects="1" show_helperpath="0" x="0" y="0" edit_clipping_paths="0" edit_masks="0" /> <eventcontext id="tweak" selcue="0" gradientdrag="0" show_handles="0" width="0.2" force="0.2" fidelity="0.5" usepressure="1" style="fill:red;stroke:none;" usecurrent="0"/> <eventcontext id="spray" selcue="1" gradientdrag="0" usepressure="1" width="15" population="70" mode="1" rotation_variation="0" scale_variation="0" standard_deviation="70" mean="0"/> |
