summaryrefslogtreecommitdiffstats
path: root/src/graphlayout.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-06-08 16:45:59 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-06-08 17:02:14 +0000
commit85f5be05f66382c9f2095749d0edbd41f6e861a5 (patch)
treecb865d916d07c11ce9875ab1f4f40770001929db /src/graphlayout.cpp
parentStop crash when Text > Outermost element is active (diff)
downloadinkscape-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/graphlayout.cpp')
0 files changed, 0 insertions, 0 deletions