summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRosen Matev <rosen.matev@cern.ch>2019-07-14 10:17:47 +0200
committerRosen Matev <rosen.matev@cern.ch>2019-07-14 10:17:47 +0200
commitb3a8203c08d948a4afb60f1e172667d07caff35d (patch)
treeea42e02033b1db0ceebfc9bf258a97b168c7d2ae /src
parenta8615a59611617a1cc9f07e1fd063b74f6001886 (diff)
downloaddistcc-git-b3a8203c08d948a4afb60f1e172667d07caff35d.tar.gz
Fix compilation with gcc 8 (-Wstringop-truncation)
``` src/rpc.c: In function ‘dcc_r_sometoken_int’: src/rpc.c:221:5: error: ‘strncpy’ output may be truncated copying 4 bytes from a string of length 12 [-Werror=stringop-truncation] strncpy(token, buf, 4); ^~~~~~~~~~~~~~~~~~~~~~ ```
Diffstat (limited to 'src')
-rw-r--r--src/rpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpc.c b/src/rpc.c
index 56210d7..111b86a 100644
--- a/src/rpc.c
+++ b/src/rpc.c
@@ -218,7 +218,7 @@ int dcc_r_sometoken_int(int ifd, char *token, unsigned *val)
return ret;
}
- strncpy(token, buf, 4);
+ memcpy(token, buf, 4);
token[4] = '\0';
buf[12] = '\0'; /* terminate */