mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-24 01:01:52 +02:00
eglibc: replace the use of stpncpy with strncpy + manual termination (stpncpy is not available on darwin)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14212 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
e8baf33f7b
commit
3d494a3826
@ -30,6 +30,20 @@
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
@@ -998,9 +1002,10 @@ mkfile_output (struct commandline *cmd)
|
||||
abort ();
|
||||
temp = rindex (cmd->infile, '.');
|
||||
cp = stpcpy (mkfilename, "Makefile.");
|
||||
- if (temp != NULL)
|
||||
- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
|
||||
- else
|
||||
+ if (temp != NULL) {
|
||||
+ strncpy (cp, cmd->infile, temp - cmd->infile);
|
||||
+ cp[temp - cmd->infile - 1] = '\0';
|
||||
+ } else
|
||||
stpcpy (cp, cmd->infile);
|
||||
|
||||
}
|
||||
--- a/libc/sunrpc/rpc_scan.c
|
||||
+++ b/libc/sunrpc/rpc_scan.c
|
||||
@@ -39,7 +39,11 @@
|
||||
|
Loading…
Reference in New Issue
Block a user