mirror of
https://git.freebsd.org/ports.git
synced 2025-06-04 20:36:30 -04:00
Atftp is a client/server implementation of the TFTP protocol that implements RFCs 1350, 2090, 2347, 2348, and 2349. The server is multi-threaded and the client presents a friendly interface using libreadline. The current server implementation lacks IPv6 support.
15 lines
368 B
C
15 lines
368 B
C
--- tftp_def.c.orig 2010-10-05 09:43:06.000000000 +0800
|
|
+++ tftp_def.c 2010-10-05 09:43:53.000000000 +0800
|
|
@@ -140,8 +140,10 @@
|
|
*/
|
|
inline char *Strncpy(char *to, const char *from, size_t size)
|
|
{
|
|
- to[size-1] = '\000';
|
|
- return strncpy(to, from, size - 1);
|
|
+ strncpy(to, from, size);
|
|
+ if (size > 0)
|
|
+ to[size-1] = '\000';
|
|
+ return to;
|
|
}
|
|
|
|
|