From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eRbkB-0001j5-UO for barebox@lists.infradead.org; Wed, 20 Dec 2017 10:37:02 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 20 Dec 2017 11:36:44 +0100 Message-Id: <20171220103644.10918-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] string.h: Implement strndup To: barebox@lists.infradead.org SSBpbXBsZW1lbnRlZCB0aGlzIHdoaWxlIHRyeWluZyB0byBpbXBvcnQgbW1jLXV0aWxzIGludG8g YmFyZWJveC4gV2hpbGUKSSBkaWRuJ3QgZmluaXNoIHRoaXMgaW1wb3J0IHRoaXMgZnVuY3Rpb24g bWlnaHQgc3RpbGwgYmUgdXNlZnVsIGZvcgpzb21lb25lPyEKClNpZ25lZC1vZmYtYnk6IFV3ZSBL bGVpbmUtS8O2bmlnIDx1LmtsZWluZS1rb2VuaWdAcGVuZ3V0cm9uaXguZGU+Ci0tLQogaW5jbHVk ZS9saW51eC9zdHJpbmcuaCB8ICAzICsrKwogbGliL3N0cmluZy5jICAgICAgICAgICB8IDIwICsr KysrKysrKysrKysrKysrKysrCiAyIGZpbGVzIGNoYW5nZWQsIDIzIGluc2VydGlvbnMoKykKCmRp ZmYgLS1naXQgYS9pbmNsdWRlL2xpbnV4L3N0cmluZy5oIGIvaW5jbHVkZS9saW51eC9zdHJpbmcu aAppbmRleCA1ZGY4YzUwZTU3OWEuLmVkNGVlYjU1MTllNiAxMDA2NDQKLS0tIGEvaW5jbHVkZS9s aW51eC9zdHJp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