mirror of
https://github.com/simh/simh.git
synced 2026-01-13 15:27:14 +00:00
Compiler detected unsigned bug
This commit is contained in:
parent
5284f8f1e6
commit
3049f16af2
@ -459,10 +459,9 @@ int strnicmp (const char *a, const char *b, size_t n)
|
|||||||
{
|
{
|
||||||
int ca, cb;
|
int ca, cb;
|
||||||
|
|
||||||
for (;;) {
|
if (n == 0) return 0; /* zero length compare is equal */
|
||||||
if (--n < 0) /* still equal after n characters? quit now */
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
if ((ca = *a) == 0) /* get character, stop on null terminator */
|
if ((ca = *a) == 0) /* get character, stop on null terminator */
|
||||||
return *b ? -1 : 0;
|
return *b ? -1 : 0;
|
||||||
|
|
||||||
@ -477,6 +476,9 @@ int strnicmp (const char *a, const char *b, size_t n)
|
|||||||
return ca;
|
return ca;
|
||||||
|
|
||||||
a++, b++;
|
a++, b++;
|
||||||
|
|
||||||
|
if (--n == 0) /* still equal after n characters? quit now */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user