diff options
author | Rosen Matev <rosen.matev@cern.ch> | 2019-07-14 10:17:47 +0200 |
---|---|---|
committer | Rosen Matev <rosen.matev@cern.ch> | 2019-07-14 10:17:47 +0200 |
commit | b3a8203c08d948a4afb60f1e172667d07caff35d (patch) | |
tree | ea42e02033b1db0ceebfc9bf258a97b168c7d2ae /src | |
parent | a8615a59611617a1cc9f07e1fd063b74f6001886 (diff) | |
download | distcc-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 */ |