mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-21 20:26:45 +00:00
Convert a bunch of sprintf to snprintf calls
This batch is the straightforward set - others are more complex and need more analysis to determine right size to pass. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
b967bf2af2
commit
05d8a7f7a7
20 changed files with 119 additions and 115 deletions
|
|
@ -1489,7 +1489,7 @@ get_addr_by_name(
|
|||
if (port == 0) {
|
||||
pport = NULL;
|
||||
} else if (port > 0 && port < 65535) {
|
||||
sprintf(portstr, "%d", port);
|
||||
snprintf(portstr, sizeof(portstr), "%d", port);
|
||||
} else {
|
||||
FatalError("Xserver: port out of range: %d\n", port);
|
||||
}
|
||||
|
|
@ -1612,7 +1612,7 @@ get_mcast_options(int argc, char **argv, int i)
|
|||
}
|
||||
|
||||
if (xdm_udp_port > 0 && xdm_udp_port < 65535) {
|
||||
sprintf(portstr, "%d", xdm_udp_port);
|
||||
snprintf(portstr, sizeof(portstr), "%d", xdm_udp_port);
|
||||
} else {
|
||||
FatalError("Xserver: port out of range: %d\n", xdm_udp_port);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue