diff options
author | Ian Lance Taylor <iant@golang.org> | 2013-06-25 10:44:25 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2013-06-25 10:44:25 -0700 |
commit | e259828ddf559b0910290c004fcc02f940860581 (patch) | |
tree | cadbe9796950d285d81a08142a211a6ad11068fe /src/lib9/dirfstat.c | |
parent | 31d4ee6227d6a390712b66cb077c1e38df026e49 (diff) | |
download | go-e259828ddf559b0910290c004fcc02f940860581.tar.gz |
lib9: avoid all -Wconversion warnings
Built after adding -Wconversion to the list of compiler
arguments used when building. I believe these are all OK
assuming we will not change the API. There is no effort to
detect overflow due to very long strings.
R=golang-dev, dave, rsc, r
CC=golang-dev
https://codereview.appspot.com/10195044
Diffstat (limited to 'src/lib9/dirfstat.c')
-rw-r--r-- | src/lib9/dirfstat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib9/dirfstat.c b/src/lib9/dirfstat.c index 17fe10aee..8cc338409 100644 --- a/src/lib9/dirfstat.c +++ b/src/lib9/dirfstat.c @@ -43,10 +43,10 @@ dirfstat(int fd) snprint(tmp, sizeof tmp, "/dev/fd/%d", fd); nstr = _p9dir(&st, &st, tmp, nil, nil, nil); - d = malloc(sizeof(Dir)+nstr); + d = malloc(sizeof(Dir)+(size_t)nstr); if(d == nil) return nil; - memset(d, 0, sizeof(Dir)+nstr); + memset(d, 0, sizeof(Dir)+(size_t)nstr); str = (char*)&d[1]; _p9dir(&st, &st, tmp, d, &str, str+nstr); return d; |