Hi Matt,
On Friday, September 18, 2015 at 11:58:19 PM UTC-5, Matthew Schinkel wrote:
>
> Hi,
>
> I've added you to GitHub
>
Thanks!
> .
>
> It's always good to make a post about changes to other libraries. I'd say
> it's ok to fix typo's or small things. You'll have to use your own good
> judgement. Some authors are not contributors any more, so you can ask the
> group if it is a big change.
>
Will do!
>
> I am the author of strings.jal, Oliver also made changes to the file. What
> needs to be fixed in it?
>
> Matt.
>
In both string_compare and string_compare_case, when you are checking for
differing lengths due only to NULL termination, you are checking string1 as
the shorter string twice.
>From the library:
if count(string1) == count(string2) then --Checks if string lengths
are the same
if step == (count(string1) - 1) then --Checks if you've
iterated over the entire string
return TRUE
end if
elsif step == (count(string1) - 1) then --Checks if this is the
last character for string1
if string2[step + 1] == ASCII_NULL then --Checks to see if
string2 is longer only due to NULL termination (this is fine)
return TRUE
else
return FALSE
end if
elsif step == (count(string1) - 1) then --This should be
count(string2) instead of count(string1) since we've already checked for
string1 being shorter
if string1[step + 1] == ASCII_NULL then
return TRUE
else
return FALSE
end if
end if
Luckily since this is the second elsif with that condition, it would never
have been executed because if it had been, the next statement would have
caused an index out of bounds error trying to access string1[step + 1]. I
think this was just a copy and paste error.
Shawn
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.