mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-17 15:36:50 +00:00
Crash fix: Strlen2 now checks for null pointers
This commit is contained in:
parent
f1dddcfb10
commit
2976ed8cd7
@ -204,8 +204,11 @@ int Strlen2(const char *one, const char *two)
|
|||||||
{
|
{
|
||||||
const char *s1,*s2;
|
const char *s1,*s2;
|
||||||
|
|
||||||
|
if (one)
|
||||||
for(s1=one;*s1;s1++);
|
for(s1=one;*s1;s1++);
|
||||||
|
if (two)
|
||||||
for(s2=two;*s2;s2++);
|
for(s2=two;*s2;s2++);
|
||||||
|
|
||||||
return((s1 - one) + (s2 - two));
|
return((s1 - one) + (s2 - two));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user