diff options
author | Ulrich Drepper <drepper@redhat.com> | 2006-04-28 17:01:50 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2006-04-28 17:01:50 +0000 |
commit | 912873399c3897bfc35c6770ef1a13ad6e991bf6 (patch) | |
tree | 9f681673e8dbb46686f0845fc5767c113ee80262 /nis | |
parent | 464c9fadafa7e8c30d0e2fd5914e0d6011f1f8ef (diff) | |
download | glibc-912873399c3897bfc35c6770ef1a13ad6e991bf6.tar.gz glibc-912873399c3897bfc35c6770ef1a13ad6e991bf6.tar.xz glibc-912873399c3897bfc35c6770ef1a13ad6e991bf6.zip |
* nis/ypclnt.c (__xdr_ypresp_all): Minor optimization in string
handling. Fix typo in comment.
Diffstat (limited to 'nis')
-rw-r--r-- | nis/ypclnt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nis/ypclnt.c b/nis/ypclnt.c index 65bc8d1f50..ae04ee9212 100644 --- a/nis/ypclnt.c +++ b/nis/ypclnt.c @@ -686,10 +686,10 @@ __xdr_ypresp_all (XDR *xdrs, struct ypresp_all_data *objp) if we don't modify the length. So add an extra NUL character to avoid trouble with broken code. */ objp->status = YP_TRUE; - memcpy (key, resp.ypresp_all_u.val.key.keydat_val, keylen); - key[keylen] = '\0'; - memcpy (val, resp.ypresp_all_u.val.val.valdat_val, vallen); - val[vallen] = '\0'; + *((char *) __mempcpy (key, resp.ypresp_all_u.val.key.keydat_val, + keylen)) = '\0'; + *((char *) __mempcpy (val, resp.ypresp_all_u.val.val.valdat_val, + vallen)) = '\0'; xdr_free ((xdrproc_t) xdr_ypresp_all, (char *) &resp); if ((*objp->foreach) (objp->status, key, keylen, val, vallen, objp->data)) @@ -700,7 +700,7 @@ __xdr_ypresp_all (XDR *xdrs, struct ypresp_all_data *objp) objp->status = resp.ypresp_all_u.val.stat; xdr_free ((xdrproc_t) xdr_ypresp_all, (char *) &resp); /* Sun says we don't need to make this call, but must return - immediatly. Since Solaris makes this call, we will call + immediately. Since Solaris makes this call, we will call the callback function, too. */ (*objp->foreach) (objp->status, NULL, 0, NULL, 0, objp->data); return TRUE; |