Oops again: fix use of classpath.c.
[gnulib.git] / lib / xmalloc.c
index 9b7a948..c1632b9 100644 (file)
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #if HAVE_CONFIG_H
 # include <config.h>
@@ -211,11 +211,19 @@ xcalloc (size_t n, size_t s)
 }
 
 /* Clone an object P of size S, with error checking.  There's no need
-   for xnclone (P, N, S), since xclone (P, N * S) works without any
+   for xnmemdup (P, N, S), since xmemdup (P, N * S) works without any
    need for an arithmetic overflow check.  */
 
 void *
-xclone (void const *p, size_t s)
+xmemdup (void const *p, size_t s)
 {
   return memcpy (xmalloc (s), p, s);
 }
+
+/* Clone STRING.  */
+
+char *
+xstrdup (char const *string)
+{
+  return xmemdup (string, strlen (string) + 1);
+}