summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-07-09 20:18:14 (GMT)
committerBrad King <brad.king@kitware.com>2003-07-09 20:18:14 (GMT)
commit36880845b66fbe9062fb9e72b703a14dfb2c2036 (patch)
tree093ca68724b6d1f6c3ac94beaddabbd720d2c840
parentd0964a349ee5a71f520a28afe353670e89563fd0 (diff)
downloadCMake-36880845b66fbe9062fb9e72b703a14dfb2c2036.zip
CMake-36880845b66fbe9062fb9e72b703a14dfb2c2036.tar.gz
CMake-36880845b66fbe9062fb9e72b703a14dfb2c2036.tar.bz2
ERR: Using strncpy instead of snprintf for portability.
-rw-r--r--Source/kwsys/ProcessUNIX.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index 64abb4c..b14c8cf 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -526,8 +526,7 @@ int kwsysProcess_WaitForData(kwsysProcess* cp, int pipes, char** data, int* leng
{
/* Select returned an error. Leave the error description in the
pipe buffer. */
- snprintf(cp->ErrorMessage, KWSYSPE_PIPE_BUFFER_SIZE,
- "%s", strerror(errno));
+ strncpy(cp->ErrorMessage, strerror(errno), KWSYSPE_PIPE_BUFFER_SIZE);
/* Kill the child now. */
kwsysProcess_Kill(cp);
@@ -730,7 +729,7 @@ static void kwsysProcessCleanup(kwsysProcess* cp, int error)
/* If cleaning up due to an error, report the error message. */
if(error)
{
- snprintf(cp->ErrorMessage, KWSYSPE_PIPE_BUFFER_SIZE, "%s", strerror(errno));
+ strncpy(cp->ErrorMessage, strerror(errno), KWSYSPE_PIPE_BUFFER_SIZE);
cp->State = kwsysProcess_State_Error;
}
@@ -887,7 +886,7 @@ static void kwsysProcessChildErrorExit(kwsysProcess* cp)
{
/* Construct the error message. */
char buffer[KWSYSPE_PIPE_BUFFER_SIZE];
- snprintf(buffer, KWSYSPE_PIPE_BUFFER_SIZE, "%s", strerror(errno));
+ strncpy(buffer, strerror(errno), KWSYSPE_PIPE_BUFFER_SIZE);
/* Report the error to the parent through the special pipe. */
write(cp->PipeWriteEnds[KWSYSPE_PIPE_ERROR], buffer, strlen(buffer));