Re: [Kicad-developers] StrNumCmp

2016-12-04 Thread Michael Steinberg
Be careful with floating points: a separator can be a point or a comma, and you don't know what separator was used when creating a string. Never expect the separator is always a point or always a comma. You can find a mix of these 2 notations. And generally speaking, a point or a comma inside

Re: [Kicad-developers] StrNumCmp

2016-12-04 Thread jp charras
Le 04/12/2016 à 22:24, Michael Steinberg a écrit : > >>> It is similar to a string comparison (for string sorting) but unlike the >>> usual strncmp() or >>> strncasecmp() functions, when digits are encountered in a string, they are >>> converted to a number and >>> this is the number value

Re: [Kicad-developers] StrNumCmp

2016-12-04 Thread Michael Steinberg
It is similar to a string comparison (for string sorting) but unlike the usual strncmp() or strncasecmp() functions, when digits are encountered in a string, they are converted to a number and this is the number value which is taken in account for comparison. I've written my own back then

Re: [Kicad-developers] StrNumCmp

2016-12-04 Thread Simon Richter
Hi, On 04.12.2016 13:33, jp charras wrote: >> when doing other stuff I ran into one of a gazillion cases that can make >> StrNumCmp starting in >> common/string.cpp:214 crash. There are quite a few unchecked iterator >> dereferences, the aLength >> parameter is not correctly taken into

Re: [Kicad-developers] StrNumCmp

2016-12-04 Thread jp charras
Le 04/12/2016 à 13:46, Michael Steinberg a écrit : > > Am 04.12.2016 um 13:33 schrieb jp charras: >> It is similar to a string comparison (for string sorting) but unlike the >> usual strncmp() or >> strncasecmp() functions, when digits are encountered in a string, they are >> converted to a

Re: [Kicad-developers] StrNumCmp

2016-12-04 Thread Michael Steinberg
Am 04.12.2016 um 13:33 schrieb jp charras: It is similar to a string comparison (for string sorting) but unlike the usual strncmp() or strncasecmp() functions, when digits are encountered in a string, they are converted to a number and this is the number value which is taken in account for

Re: [Kicad-developers] StrNumCmp

2016-12-04 Thread jp charras
Le 04/12/2016 à 12:00, Michael Steinberg a écrit : > Hello all, > > when doing other stuff I ran into one of a gazillion cases that can make > StrNumCmp starting in > common/string.cpp:214 crash. There are quite a few unchecked iterator > dereferences, the aLength > parameter is not correctly

[Kicad-developers] StrNumCmp

2016-12-04 Thread Michael Steinberg
Hello all, when doing other stuff I ran into one of a gazillion cases that can make StrNumCmp starting in common/string.cpp:214 crash. There are quite a few unchecked iterator dereferences, the aLength parameter is not correctly taken into account, etc.. The comment on the function's