tweaks to avoid compiler warnings

This commit is contained in:
Richard Frith-Macdonald 2020-12-03 11:56:14 -05:00
parent 0b34eac9e1
commit f18594ff3e

View file

@ -1133,7 +1133,7 @@ failure:
{ {
searchRange.length = countOther; searchRange.length = countOther;
} }
if (memcmp(&bytesSelf[searchRange.location], &bytesOther[0], if (memcmp(bytesSelf + searchRange.location, bytesOther,
countOther) == 0) countOther) == 0)
{ {
result = searchRange; result = searchRange;
@ -1165,7 +1165,8 @@ failure:
{ {
while (pos-- > 0) while (pos-- > 0)
{ {
if (memcmp(&bytesSelf[searchRange.location + pos], bytesOther, countOther) == 0) if (memcmp(bytesSelf + searchRange.location + pos,
bytesOther, countOther) == 0)
{ {
break; break;
} }
@ -1175,7 +1176,8 @@ failure:
{ {
while (pos < end) while (pos < end)
{ {
if (memcmp(&bytesSelf[searchRange.location + pos], bytesOther, countOther) == 0) if (memcmp(bytesSelf + searchRange.location + pos,
bytesOther, countOther) == 0)
{ {
break; break;
} }
@ -1981,8 +1983,8 @@ failure:
int desc; int desc;
int mask; int mask;
strncpy(thePath, theRealPath, sizeof(thePath) - 1); strncpy(thePath, theRealPath, sizeof(thePath) - 7);
thePath[sizeof(thePath) - 1] = '\0'; thePath[sizeof(thePath) - 7] = '\0';
strncat(thePath, "XXXXXX", 6); strncat(thePath, "XXXXXX", 6);
if ((desc = mkstemp(thePath)) < 0) if ((desc = mkstemp(thePath)) < 0)
{ {