diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-03 03:07:25 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-03 03:07:25 +0000 |
commit | ba196a9d1707361a6f9928f3fd616138e2c58647 (patch) | |
tree | 3f714459c4594f31afa8dc960f15ed3a26174d45 /src/or/buffers.c | |
parent | 8a1ad2b84e180f1851feb467ceb0a636689e724a (diff) | |
download | tor-ba196a9d1707361a6f9928f3fd616138e2c58647.tar.gz tor-ba196a9d1707361a6f9928f3fd616138e2c58647.zip |
Use (set|get)_uint(16|32) in lieu of memcpy where reasonable.
svn:r1462
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index aac3294625..5960eff2f7 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -487,8 +487,7 @@ int fetch_from_buf_socks(buf_t *buf, socks_request_t *req) { } memcpy(req->address,buf->mem+5,len); req->address[len] = 0; - memcpy(&req->port, buf->mem+5+len, 2); - req->port = ntohs(req->port); + req->port = ntohs(get_uint16(buf->mem+5+len)); buf_remove_from_front(buf, 5+len+2); return 1; default: /* unsupported */ |