mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-03 06:20:57 +00:00
Fix bugs found through gcc's warnings.
This commit is contained in:
parent
bc684222fc
commit
78fee72c50
2 changed files with 4 additions and 2 deletions
|
@ -578,7 +578,7 @@ void Key_Console (int key)
|
||||||
// If the last two lines are identical, skip storing this line in history
|
// If the last two lines are identical, skip storing this line in history
|
||||||
// by not incrementing edit_line
|
// by not incrementing edit_line
|
||||||
if (strcmp(workline, key_lines[(edit_line-1)&31]))
|
if (strcmp(workline, key_lines[(edit_line-1)&31]))
|
||||||
edit_line = (edit_line + 1) & 31;
|
edit_line = (edit_line + 1) & (CMDLINES - 1);
|
||||||
|
|
||||||
history_line = edit_line;
|
history_line = edit_line;
|
||||||
key_lines[edit_line][0] = ']';
|
key_lines[edit_line][0] = ']';
|
||||||
|
@ -779,6 +779,8 @@ void Char_Console (int key)
|
||||||
workline[MAXCMDLINE - 2] = 0;
|
workline[MAXCMDLINE - 2] = 0;
|
||||||
workline += key_linepos;
|
workline += key_linepos;
|
||||||
len = strlen(workline) + 1;
|
len = strlen(workline) + 1;
|
||||||
|
if (len > MAXCMDLINE-2)
|
||||||
|
len = MAXCMDLINE-2;
|
||||||
memmove (workline + 1, workline, len);
|
memmove (workline + 1, workline, len);
|
||||||
*workline = key;
|
*workline = key;
|
||||||
}
|
}
|
||||||
|
|
|
@ -556,7 +556,7 @@ int WINS_GetSocketAddr (sys_socket_t socketid, struct qsockaddr *addr)
|
||||||
{
|
{
|
||||||
static const in_addr6_t in6addr_any;// = IN6ADDR_ANY_INIT;
|
static const in_addr6_t in6addr_any;// = IN6ADDR_ANY_INIT;
|
||||||
if (!memcmp(&((struct sockaddr_in6 *)addr)->sin6_addr, &in6addr_any, sizeof(in_addr6_t)))
|
if (!memcmp(&((struct sockaddr_in6 *)addr)->sin6_addr, &in6addr_any, sizeof(in_addr6_t)))
|
||||||
memcpy(&((struct sockaddr_in6 *)addr)->sin6_addr, &myAddrv6, sizeof(struct sockaddr_in6));
|
memcpy(&((struct sockaddr_in6 *)addr)->sin6_addr, &myAddrv6, sizeof(in_addr6_t));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue