Let tst-swscanf find its locale
[platform/upstream/glibc.git] / resolv / mapv4v6addr.h
index 4295398..7f85f7d 100644 (file)
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by the University of
- *      California, Berkeley and its contributors.
  * 4. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
@@ -60,16 +56,14 @@ static void
 map_v4v6_address (const char *src, char *dst)
 {
   u_char *p = (u_char *) dst;
-  char tmp[INADDRSZ];
   int i;
 
-  /* Stash a temporary copy so our caller can update in place. */
-  bcopy (src, tmp, INADDRSZ);
+  /* Move the IPv4 part to the right position.  */
+  memcpy (dst + 12, src, INADDRSZ);
+
   /* Mark this ipv6 addr as a mapped ipv4. */
   for (i = 0; i < 10; i++)
     *p++ = 0x00;
   *p++ = 0xff;
-  *p++ = 0xff;
-  /* Retrieve the saved copy and we're done. */
-  bcopy (tmp, (void *) p, INADDRSZ);
+  *p = 0xff;
 }