1204433Sraj/* 2204433Sraj * Copyright 2008 Jon Loeliger, Freescale Semiconductor, Inc. 3204433Sraj * 4204433Sraj * This program is free software; you can redistribute it and/or 5204433Sraj * modify it under the terms of the GNU General Public License as 6204433Sraj * published by the Free Software Foundation; either version 2 of the 7204433Sraj * License, or (at your option) any later version. 8204433Sraj * 9204433Sraj * This program is distributed in the hope that it will be useful, 10204433Sraj * but WITHOUT ANY WARRANTY; without even the implied warranty of 11204433Sraj * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12204433Sraj * General Public License for more details. 13204433Sraj * 14204433Sraj * You should have received a copy of the GNU General Public License 15204433Sraj * along with this program; if not, write to the Free Software 16204433Sraj * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 17204433Sraj * USA 18204433Sraj */ 19204433Sraj 20204433Sraj#include "dtc.h" 21204433Sraj 22204433Srajchar *xstrdup(const char *s) 23204433Sraj{ 24204433Sraj int len = strlen(s) + 1; 25204433Sraj char *dup = xmalloc(len); 26204433Sraj 27204433Sraj memcpy(dup, s, len); 28204433Sraj 29204433Sraj return dup; 30204433Sraj} 31