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.87 #1 (Red Hat Linux)) id 1cj5aI-0003xc-RG for barebox@lists.infradead.org; Wed, 01 Mar 2017 14:50:36 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 1 Mar 2017 15:50:04 +0100 Message-Id: <20170301145004.27750-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] memcmp: fix comparison on short read To: barebox@lists.infradead.org cmVhZCgpIG1pZ2h0IHJldHVybiBsZXNzIHRoYW4gJGNvdW50IGJ5dGVzIHdoaWNoIGlzIG9ubHkg YW4gdXBwZXIgbGltaXQuClRoZSB1c2VyIGlzIHN1cHBvc2VkIHRvIHJlcGVhdCB0aGUgY29tbWFu ZCB0byBmaWxsIGEgYnVmZmVyIGNvbXBsZXRlbHkuCgpTbyB1c2UgdGhlIGNvbnZlbmllbmNlIHdy YXBwZXIgcmVhZF9mdWxsIGluIG1lbWNtcC4KClRoaXMgZml4ZXMgbWVtY21wIG9uIC9kZXYvbmFu ZDAgb24gYW4gQXJtYWRhIFhQLgoKU2lnbmVkLW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUu a2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25peC5kZT4KLS0tCiBjb21tYW5kcy9tZW1jbXAuYyB8IDQg KystLQogMSBmaWxlIGNoYW5nZWQsIDIgaW5zZXJ0aW9ucygrKSwgMiBkZWxldGlvbnMoLSkKCmRp ZmYgLS1naXQgYS9jb21tYW5kcy9tZW1jbXAuYyBiL2NvbW1hbmRzL21lbWNtcC5jCmluZ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